How to change RadListView PullToRefresh Activity Indicator cell background color?

8 posts, 0 answers
  1. Alius
    Alius avatar
    4 posts
    Member since:
    Jul 2012

    Posted 11 Jul 2016 Link to this post

    Maybe someone already faced this issue: My app background is white, RadListView Item Background is also White, but when I'm trying to do PullToRefresh black cell pops out with white Activity Indicator inside. Preview here: http://tinypic.com/r/5pkcgw/9

    Any hint how to make it White instead of Black?

    <telerik:RadListView x:Name="SocialFeed" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
            SelectionMode="Single" IsPullToRefreshEnabled="True" BackgroundColor="Red">
        <telerik:RadListView.LayoutDefinition>
            <listView:ListViewLinearLayout Orientation="Vertical" VerticalItemSpacing="0" />
        </telerik:RadListView.LayoutDefinition>
        <telerik:RadListView.ItemStyle>
            <listView:ListViewItemStyle BackgroundColor="White" BorderWidth="1" BorderColor="#C8C7CC" BorderLocation="Bottom" />
        </telerik:RadListView.ItemStyle>   
        <telerik:RadListView.PressedItemStyle>
                <listView:ListViewItemStyle BackgroundColor="White" BorderWidth="1" BorderColor="#C8C7CC" BorderLocation="Bottom" />
        </telerik:RadListView.PressedItemStyle>
        <telerik:RadListView.SelectedItemStyle>
                <listView:ListViewItemStyle BackgroundColor="White" BorderWidth="1" BorderColor="#C8C7CC" BorderLocation="Bottom" />
        </telerik:RadListView.SelectedItemStyle>
        <telerik:RadListView.ItemTemplate>
            <DataTemplate>
            ...
            </DataTemplate>
        </telerik:RadListView.ItemTemplate>                                
    </telerik:RadListView>

  2. Rosy Topchiyska
    Admin
    Rosy Topchiyska avatar
    586 posts

    Posted 15 Jul 2016 Link to this post

    Hello Alius,

    Thank you for contacting us.

    The list view does not expose API to change the background if the refresh indicator, but you can easily change it with a custom list view renderer. I have attached a sample that demonstrates this. Please, take a look at the CustomListViewRenderer class in the AppDelegate.cs file in the iOS project.

    I hope this helps.

    Regards,
    Rosy Topchiyska
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Remi
    Remi avatar
    7 posts
    Member since:
    Oct 2017

    Posted 08 Dec 2017 Link to this post

    Hello,

    Another possibility could be to use the UIAppearance, eliminating the need of a custom renderer.

    var colorAccent = ((Color)Xamarin.Forms.Application.Current.Resources["ColorAccent"]).ToUIColor();
     
    // RadListView PullToRefresh controls
    TKListViewPullToRefreshView.Appearance.TintColor = colorAccent;
    TKListViewPullToRefreshView.Appearance.BackgroundColor = UIColor.White;

    One question though, whereas BackgroundColor is effectively taken into account, the usual TintColor does not change the loading indicator color. Is there any way to change it in a RadListView?

  4. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    625 posts

    Posted 13 Dec 2017 Link to this post

    Hello, Remi,

    As far as I understand your requirement, you would like to change the color of the indicator view. if this is the case, you can access the Indicator View through the ActivityIndicator property of the PullToRefreshView:

    protected override void OnElementChanged(ElementChangedEventArgs<RadListView> e)
            {
                base.OnElementChanged(e);
     
                this.Control.PullToRefreshView.BackgroundColor = UIColor.White;
                this.Control.PullToRefreshView.ActivityIndicator.Color = UIColor.Red;
            }

    I hope this helps.

    Regards,
    Stefan Nenchev
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Remi
    Remi avatar
    7 posts
    Member since:
    Oct 2017

    Posted 18 Dec 2017 in reply to Stefan Nenchev Link to this post

    Hello Stefan,

    I confirm that using the custom renderer h     

  6. Remi
    Remi avatar
    7 posts
    Member since:
    Oct 2017

    Posted 18 Dec 2017 in reply to Stefan Nenchev Link to this post

    Hello Stefan,

    I confirm that by using a custom renderer, I can achieve the desired behavior, many thanks to you.

    What I don't understand just yet is why Appearance is working for PullToRefreshView background color, but not for UIActivityIndicator color. I can live with that though, and i'll do the same in an Android renderer for ActivityIndicator color as well.

  7. Remi
    Remi avatar
    7 posts
    Member since:
    Oct 2017

    Posted 18 Dec 2017 in reply to Stefan Nenchev Link to this post

    Hello Stefan,

    I confirm that using by a custom renderer, I can achieve the desired behavior, many thanks to you.

    What I don't perfectly understand just yet is why setting the Appearance is working for PullToRefreshView background color, but doesn't for UIActivityIndicator color, but I can live with that.

    I'll just apply the same principles for Android ActivityIndicator color, creating a specific renderer.

  8. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    625 posts

    Posted 19 Dec 2017 Link to this post

    Hello, Remi,

    I am not sure about that, it seems like platform specific implementation. Anyway, using the custom renderers should do so you can stick to that approach.

    Have a great rest of the week.

    Regards,
    Stefan Nenchev
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top