1

I am trying to make scrollable tabs and want to set the size of the title .How can I do this as I cant set the text size in PagerTitleStrip in the xml.Can some one tell me how to do this.

2 Answers2

1

Add below style in your styles.xml

<style name="viewPagerTitleStrip">
    <item name="android:textColor">@color/primary_dark_material_light</item>
    <item name="android:textSize">20sp</item>
</style>

And then

<android.support.v4.view.PagerTitleStrip
        android:id="@+id/pager_title_strip"
        style="@style/viewPagerTitleStrip"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:layout_gravity="top"
        android:background="@color/white"
        android:paddingTop="4dp"
        android:paddingBottom="4dp" />
Passiondroid
  • 1,505
  • 1
  • 16
  • 27
1

Here is an example on how to do it: in your xml:

 <android.support.v4.view.PagerTitleStrip
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        style="@style/MyCustomTabText"/>

and in styles.xml

<style name="MyCustomTabText">
    <item name="android:textSize">12sp</item>
</style>
Salma Ali
  • 161
  • 5