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.
Asked
Active
Viewed 184 times
2 Answers
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,573
- 1
- 16
- 28
-
using gradient I can set the background of the title? – Neelay Srivastava Mar 27 '16 at 14:03
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
- 201
- 2
- 5