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
>
7 Answers, 1 is accepted
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
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?
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
Hello Stefan,
I confirm that using the custom renderer h
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.
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.
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