title: How to change selected and unselected color for Tabbed pages Title in Android: Xamarin Forms
body: <p>I have a Xamarin Forms Tabbed Page with 5 children:</p>
  
  <p><a href="https://i.stack.imgur.com/VFNNU.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VFNNU.jpg" alt="enter image description here"></a></p>
  
  <p>As the picture shows, the icon color for the selected and unselected tab are different. I want the same thing to happen on the each tabs <code>Title</code>. Is this possible?</p>
  
  <p>Edit: This feature is working perfectly in iOS. Im looking for a renderer specific for Android.</p>
  
  <p>Below is the Android renderer code responsible for changing the color of the selected and unselected icon of the children:</p>
  
  <pre><code>public class MyTabbedPageRenderer: TabbedPageRenderer
  {
     bool setup;
     ViewPager viewPager;
     TabLayout tabLayout;
  
     protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
     {
        base.OnElementPropertyChanged(sender, e);
  
        if (setup)
           return;
  
        if (e.PropertyName == "Renderer")
        {
           viewPager = (ViewPager)ViewGroup.GetChildAt(0);
           tabLayout = (TabLayout)ViewGroup.GetChildAt(1);
           setup = true;
  
           ColorStateList colors = null;
           if ((int)Build.VERSION.SdkInt &gt;= 23)
           {
              colors = Resources.GetColorStateList(Resource.Color.icon_tab, Forms.Context.Theme);
           }
           else
           {
              colors = Resources.GetColorStateList(Resource.Color.icon_tab);
           }
  
           for (int i = 0; i &lt; tabLayout.TabCount; i++)
           {
              var tab = tabLayout.GetTabAt(i);
              var icon = tab.Icon;
              if (icon != null)
              {
                 icon = Android.Support.V4.Graphics.Drawable.DrawableCompat.Wrap(icon);
    Android.Support.V4.Graphics.Drawable.DrawableCompat.SetTintList(icon, colors);
               }
           }
        }
     }
   }
  </code></pre>
  
  <p>In <code>Resources - &gt; Color</code> folder I have the following <code>xml</code> file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item android:color="#2196F3"  android:state_selected="true" /&gt;
      &lt;item android:color="#b2b2b2" /&gt;
  &lt;/selector&gt;
  </code></pre>