: http://guides.codepath.com/android/google-play-style-tabs-using-tablayout
textColor :
<style name="MyCustomTabLayout" parent="Widget.Design.TabLayout">
<item name="tabMaxWidth">@dimen/tab_max_width</item>
<item name="tabIndicatorColor">?attr/colorAccent</item>
<item name="tabIndicatorHeight">2dp</item>
<item name="tabPaddingStart">12dp</item>
<item name="tabPaddingEnd">12dp</item>
<item name="tabBackground">@android:color/white</item>
<item name="tabTextAppearance">@style/MyCustomTabTextAppearance</item>
<item name="tabSelectedTextColor">?android:textColorPrimary</item>
</style>
<style name="MyCustomTabTextAppearance" parent="TextAppearance.Design.Tab">
<item name="android:textSize">14sp</item>
<item name="android:textColor">#000000</item>
<item name="textAllCaps">true</item>
</style>
TabLayout:
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
style="@style/MyCustomTabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</android.support.design.widget.TabLayout>
.
: , , :
app:tabBackground="@android:color/white"
app:tabTextColor="@color/darkcolor"
:
<android.support.design.widget.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:tabIndicatorColor="#ffffff"
app:tabIndicatorHeight="4dp"
app:tabBackground="@android:color/white"
app:tabTextColor="@color/darkcolor"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />