标题栏。
// TODO 缺少图
一、使用
1. 去除原生 ActionBar
修改 res/values/styles.xml 文件,将 parent 改成 NoActionBar,意思是不用系统自带的标题栏。(系统自带的标题栏叫做 ActionBar)

2. 布局文件
在要添加标题栏的活动布局文件中添加 Toolbar 子控件。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"android:layout_width="match_parent"android:layout_height="match_parent"><android.support.v7.widget.Toolbarandroid:id="@+id/toolbar"android:layout_width="match_parent"android:layout_height="?attr/actionBarSize"android:background="?attr/colorPrimary"android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/></LinearLayout>
3. 添加 toolbar 标题栏
这里注意 Toolbar 引包有两个,一个是 app.widget,一个是 support.v7,使用 v7 包里的 Toolbar。
@Overrideprotected void onCreate(Bundle savedInstanceState) {// .......Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);setSupportActionBar(toolbar);}
