Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How can I change the font style on ActionBarSherlock
- <style name="Theme.MyAppDefaults" parent="@style/Theme.Sherlock.Light">
- <item name="android:textSize">@dimen/default_textsize</item>
- <item name="actionBarSize">@dimen/action_bar_height</item>
- </style>
- <style name="Theme.MyApp.Default" parent="@style/Theme.Sherlock.Light">
- <item name="actionBarStyle">@style/MyApp.SherlockActionBarStyle</item>
- <item name="android:actionBarStyle">@style/MyApp.SherlockActionBarStyle</item>
- </style>
- <style name="MyApp.SherlockActionBarStyle" parent="@style/Widget.Sherlock.ActionBar">
- <item name="titleTextStyle">@style/MyApp.ActionBar.TextAppearance</item>
- </style>
- <style name="MyApp.ActionBar.TextAppearance" parent="@style/TextAppearance.Sherlock.Widget.ActionBar.Menu">
- <item name="android:textSize">@dimen/default_textsize</item>
- <item name="android:textColor">@color/dark_grey</item>
- </style>
- <TextView
- android:id="@+id/action_custom_title"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="My Custom title"
- android:textColor="#fff"
- android:textSize="18sp" />
- _actionBar.setDisplayShowTitleEnabled(false);
- LayoutInflater inflater = LayoutInflater.from(this);
- View customView = inflater.inflate(R.layout.custom_action_layout, null);
- TextView titleTV = (TextView) customView.findViewById(R.id.action_custom_title);
- // you can apply a custom typeface here or do sth else...
- _actionBar.setCustomView(customView);
- _actionBar.setDisplayShowCustomEnabled(true);
Add Comment
Please, Sign In to add comment