1.使用Toolbar代替ActionBar
有Theme.AppCompat.NoActionBar(深色主题)和Theme.AppCompat.Light.NoActionBar(浅色主题)两种主题可选
(1)将Action隐藏起来
style.xml:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
(2)用Toolbar代替ActionBar
activit_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xm