1. 程式人生 > >Android 去掉titlebar

Android 去掉titlebar

只需要將預設的styles.xml

<resources>

<!-- Base application theme. -->
<style name=“AppTheme” parent=“Theme.AppCompat.Light.DarkActionBar”>
<!-- Customize your theme here. -->
<item name=“colorPrimary”>@color/colorPrimary</item>
<item
name=“colorPrimaryDark”>@color/colorPrimaryDark</item>
<item name=“colorAccent”>@color/colorAccent</item>
</style>

</resources>

修改成
<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>