Вы можете добавить две строки в панели действий, такие как заголовок и субтитры. Для этого вам нужно установить DISPLAY_SHOW_TITLE
Я предложу два ресурса для этого. пример реализации setDisplayOptions и Официальный do c
Вы можете использовать эти коды также в качестве справочного,
XML:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:text="Android Actionbar Title and SubTitle Example"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Android action bar title and subtitle tutorial with example. learn
to add subtitle in android actionbar" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:autoLink="web"
android:gravity="center|bottom"
android:text="ViralAndroid.com"
android:textSize="24sp"
android:textStyle="bold" />
</LinearLayout>
JAVA:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.actionbar_title_and_subtitle);
android.support.v7.app.ActionBar actionBar = getSupportActionBar();
actionBar.setTitle("ActionBar Title");
actionBar.setSubtitle(Html.fromHtml("<font color='#FFBF00'>Here ActionBar
Subtitle</font>"));
}
Для значка вы можете следовать this