i trying set style , size of pager title strip .but able set text color , size not able set style how set different style in pager title strip. here tried
style
<style name="apptheme.my" parent="base.textappearance.appcompat.caption"> <item name="android:textcolor">@color/text</item> <item name="android:textsize">@dimen/text</item> <item name="android:typeface">serif</item> </style> <android.support.v4.view.pagertitlestrip android:id="@+id/title" style="@style/apptheme.my" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="top" android:layout_margintop="15dp" android:background="#fb263238" android:alpha="0.3" android:paddingtop="4dp" />
my java pager title
public charsequence getpagetitle(int position) { string title = new string(); if (position == 0) { return "albums"; } if (position == 1) { return "artists"; } if (position == 4) { return "playlist"; } if (position == 3) { return "genres"; } if (position == 2) { return "songs"; } return title; }
what doing wrong , how can set text style in pager title strip??
i have modified code. can check below code.
<android.support.v4.view.pagertitlestrip android:id="@+id/title" style="@style/stylepagertitlestrip" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="top" android:layout_margintop="15dp" android:background="#fb263238" android:alpha="0.3" android:paddingtop="4dp" /> <style name="stylepagertitlestrip"> <item name="android:textcolor">@color/text</item> <item name="android:textsize">@dimen/text</item> <item name="android:fontfamily">sans-serif</item> </style>
Comments
Post a Comment