在style.xml 加入
<item name="android:windowNoTitle">true</item>
按理說可以把標題欄隱藏,但是當style是appCompat的某個主題的時候,這樣自定義style好像不起作用,重新運行標題欄還在。在網上找了半天,終于找到解決方法了 -
把android:windowNoTitle改為 windowNoTitle ,重新運行就OK拉!
例:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="windowNoTitle">true</item>
</style>```