I am working on a Xamarin forms project.
I have a tabbed page with 9 tabs. 4 tabs would show with description and icon in tab bar, and there is extra tab is added "More" which contains list of other tabs.
In Appdelegate.cs file I set
UITabbar.appearance.SelectedImageTintColor = UIColor.green;
And also this is my Custom tab renderer:
public class CustomTabRenderer : TabbedRenderer
{
protected override void OnElementChanged(VisualElementChangedEventArgs e)
{
base.OnElementChanged(e);
TabBar.TintColor = new UIColor(red: 0.55f, green: 0.76f, blue: 0.29f, alpha: 1.0f);
}
public override void ViewDidAppear(bool animated)
{
base.ViewDidAppear(animated);
if (TabBar.Items == null) return;
TabBar.SelectedImageTintColor = new UIColor(red: 0.55f, green: 0.76f, blue: 0.29f, alpha: 1.0f);
foreach (var uiTabBarItem in TabBar.Items)
{
var fontSize = new UITextAttributes(){ Font = UIFont.SystemFontOfSize(13)};
uiTabBarItem.SetTitleTextAttributes(fontSize, UIControlState.Normal);
}
}
public override void ItemSelected(UITabBar tabbar, UITabBarItem item)
{
tabbar.SelectedImageTintColor = new UIColor(red: 0.55f, green: 0.76f, blue: 0.29f, alpha: 1.0f);
}
So all the 4 tabs on the bar bar are green color, but the tabs in "More" Section are always blue.
Any solution please? Also can we put colored images into tab bar?