I\'m trying to set a tintColor on my UIRefreshControl (building on iOS 7).
I enabled refreshing for the tableViewController in storyboard, then in my ViewController vi
I am working with Xamarin C# (iOS 10) and found that a combination of all of these answers is what fixed it for me.
In my ViewDidLoad
I have the following:
RefreshControl = new UIRefreshControl();
RefreshControl.TintColor = UIColor.White;
RefreshControl.ValueChanged += OnRefresh;
RefreshControl.BackgroundColor = UIColor.Clear;
And later I programmatically call the refresh animation in my ViewDidAppear
with the following:
BeginInvokeOnMainThread(() =>
{
UIView.Animate(0, 0.2, UIViewAnimationOptions.BeginFromCurrentState, () =>
{
TableView.SetContentOffset(new CGPoint(0, TableView.ContentOffset.Y - RefreshControl.Frame.Size.Height), true);
RefreshControl.AttributedTitle = new NSAttributedString("");
},
() =>
{
RefreshControl.BeginRefreshing();
});
});
Note the setting of the attributed title and animation block were the parts I was missing for my RefreshControl
to take my white tint color.
Thanks to all that have contributed to this question.