Change tabs style in TabbedPage in Xamarin.Forms

0

I have been trying to change the style (color background, color of letters and indicator) of the tabs in Xamarin.Forms , I have tried to make my own custom render but it seems that it does not work. p>

What works is changing the colors by XML , but when I do it it breaks all the style that I had in the shared project of Xamarin.Forms .

Someone knows the correct way to change ( at least ) the color background of the tabs in a TabbedPage from:

  • Xamarin.Forms (From the Shared project , not XML )
  • XML (Only if there was a way to change only the style of the Tabs without touching any other style)
  • I've been trying to do it for days but I could not, I think I'm already blocked by now.

        
    asked by Enrique Zavaleta 01.05.2016 в 00:30
    source

    1 answer

    0

    You can directly modify the resource Tabbar.axml within Resources > layout.

    <android.support.design.widget.TabLayout 
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/sliding_tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/colorPrimary"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        style="@style/MyTabLayout"
        app:tabIndicatorColor="@android:color/white"
        app:tabGravity="fill"
        app:tabMode="fixed" />
    

    There are the properties app:tabIndicatorColor and android:background .

        
    answered by 04.01.2018 в 08:33