Using Xamarin.Forms, I have a custom TabbedPageRenderer in iOS. Now, I can change the text color on a selected TabBarItem, but I can't change the background color of the selected tab. Does anyone know how?
class CustomTabbedPageRenderer : TabbedRenderer
{
public override UIViewController SelectedViewController
{
get
{
UITextAttributes attr = new UITextAttributes();
attr.TextColor = UIColor.White;
if (base.SelectedViewController != null)
{
base.SelectedViewController.TabBarItem.SetTitleTextAttributes(attr, UIControlState.Normal);
// TODO: How to set background color for ONE item?
}
return base.SelectedViewController;
}
set
{
base.SelectedViewController = value;
}
}
}