If you just need to change the style of the header, you can add a custom view as follows:
<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" />
Then hide the actual name and show the custom view.
_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);
It's all! If you're interested, what is the default font size for the ActionBar name is 18sp.
lomza
source share