<android.support.v7.widget.toolbar
Android:id= "@+id/toolbar_top"
android:layout_height= "Wrap_content"
Android:layout_width= "Match_parent"
android:minheight= "Attr/actionbarsize" >
<textview
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
android:text= "Toolbar Title"
android:layout_gravity= "Center"
Android:id= "@+id/toolbar_title"/>
</android.support.v7.widget.Toolbar>
This means is the can style the TextView however you would like because it ' s just a regular TextView. So in your activity you can access the title like so:
Toolbar toolbarTop = (Toolbar) findViewById(R.id.toolbar_top);TextView mTitle = (TextView) toolbarTop.findViewById(R.id.toolbar_title);
If anyone else can ' t remove the default app name title, do this:
1. setSupportActionBar(yourToolbar)
Call
2, Call
Getsupportactionbar (). setdisplayshowtitleenabled (false); '
Android Toolbar fake Title Center