RadListView iOS PullToRefresh Background

Thread is closed for posting
2 posts, 0 answers
  1. Ericky
    Ericky avatar
    49 posts
    Member since:
    Jun 2017

    Posted 02 Aug 2017 Link to this post

    Hello,

     

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

  2. Nikolay Tsonev
    Admin
    Nikolay Tsonev avatar
    340 posts

    Posted 03 Aug 2017 Link to this post

    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.
Back to Top