In my case I want to set toolbar title and subtitle in centre. I have already one solution to set custom layout in toolbar. Is that any other solution to set toolbar title and subtitle without using custom layout?
Solution 1:
<android.support.v7.widget.Toolbar
android:id="@+id/custom_toolbar"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:background="@android:color/holo_red_dark">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="abc"
android:textColor="@android:color/white"
android:textSize="20sp"
android:layout_marginRight="?android:attr/actionBarSize"
android:gravity="center"/>
</android.support.v7.widget.Toolbar>
I don't want to use custom layout to set toolbar title and subtitle.I appreciate your effort, in advance.