This is a migrated thread and some comments may be shown as answers.

RadListView iOS PullToRefresh Background

1 Answer 128 Views
ListView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ericky
Top achievements
Rank 1
Ericky asked on 02 Aug 2017, 07:53 PM

Hello,

 

Is there any way to set the background color of the pullToRefresh view on iOS?

1 Answer, 1 is accepted

Sort by
0
Nikolay Tsonev
Telerik team
answered on 03 Aug 2017, 07:23 AM
Hi Ericky,

At this time you could change the view background color by accessing the native property "pullToRefreshView" from code behind, where you could change the color. You could review the attached example.
XML
<GridLayout backgroundColor="green" orientation="vertical" rows="auto, *">
     <!-- >> listview-pull-to-refresh-xml -->
        <lv:RadListView loaded="lvloaded" backgroundColor="green" items="{{ dataItems }}" pullToRefresh="true" row="1" pullToRefreshInitiated="{{onPullToRefreshInitiated}}">
     <!-- << listview-pull-to-refresh-xml -->
            <lv:RadListView.itemTemplate>
              <StackLayout orientation="vertical" padding="5 10 5 10"  style="background-color: #7fff7f;">
                <StackLayout orientation="horizontal" padding="10" style="background-color: #65a565;">
                    <Image src="{{ image + '.jpg'}}" stretch="aspectFit" height="100" width="100"/>
                   <StackLayout orientation="vertical" marginLeft="15">
                    <Label fontSize="20" text="{{ name }}" marginBottom="8"/>
                    <Label fontSize="14" text="{{ title }}" style="font-weight: bold;" textWrap="true"/>
                    <Label fontSize="12" text="{{ text }}" color="White" textWrap="true"/>
                </StackLayout>
                </StackLayout>
                </StackLayout>
            </lv:RadListView.itemTemplate>
            <lv:RadListView.pullToRefreshStyle backgroundColor="blue">
                 
                    <lv:PullToRefreshStyle  indicatorColor="red" indicatorBackgroundColor="blue"/>
 
            </lv:RadListView.pullToRefreshStyle>
        </lv:RadListView>
    </GridLayout>


TypeScript

export function lvloaded(args){
    if(isIOS){
        args.object.ios.pullToRefreshView.backgroundColor = (new Color("#000000")).ios;
    }
}


We have also logged a new feature request for exposing this property in the NativeScript component. You could keep track on the issue for further info.

Regards,
nikolay.tsonev
Progress Telerik
Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
Tags
ListView
Asked by
Ericky
Top achievements
Rank 1
Answers by
Nikolay Tsonev
Telerik team
Share this question
or