如何从我的应用程序中删除 Headers 栏 .
我尝试通过在主题末尾添加“NoTitleBar”来对清单文件进行更改,并且我也按照此问题中给出的答案进行了操作
“How to hide the title bar for an Activity in XML with existing custom theme”
但他们都没有为我工作 . 请帮忙
如何从我的应用程序中删除 Headers 栏 .
我尝试通过在主题末尾添加“NoTitleBar”来对清单文件进行更改,并且我也按照此问题中给出的答案进行了操作
“How to hide the title bar for an Activity in XML with existing custom theme”
但他们都没有为我工作 . 请帮忙
3 回答
您可以在oncreate函数中设置视图之前添加活动 .
这是因为您的活动正在扩展ActionBarActivity . 您可以通过扩展活动的活动来替换 .
我希望这能解决你的问题 .
用这个:
在你的活动中 .
在
AndroidManifest.xml
文件中,您可以找到标签<application
该标签包含android:theme
属性,它必须类似于"@style/AppTheme"
. 打开文件styles.xml
. 找到标签style name="AppTheme"
并将其parent
属性更改为Theme.AppCompat.Light.NoActionBar
.就我而言
要隐藏
preview mode
上的 Headers 栏,请单击方向切换器按钮旁边的按钮,必须打开一个弹出窗口,您可以在其中选择一种样式 . 选择一个NoActionBar
,例如DeviceDefault.Light.NoActionBar