无法删除android中的标题栏
我已经尝试了这三种方法,但仍然无法删除标题栏 此方法删除androidstudio(1.4)中的标题栏,但我仍然可以在emulator中看到标题栏: 这两种方法会使应用程序崩溃: Styles.xml: 编辑(如何修复):如果您从活动而不是java文件中的appcompat继承,它将起作用。无法删除android中的标题栏,android,titlebar,Android,Titlebar,我已经尝试了这三种方法,但仍然无法删除标题栏 此方法删除androidstudio(1.4)中的标题栏,但我仍然可以在emulator中看到标题栏: 这两种方法会使应用程序崩溃: Styles.xml: 编辑(如何修复):如果您从活动而不是java文件中的appcompat继承,它将起作用。 <style name="AppBaseTheme" parent="android:Theme.Holo.Light.NoActionBar"> <!-- API 11 th
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.NoActionBar">
<!-- API 11 theme customizations can go here. -->
</style>
在所有styles.xml文件中张贴此行。将styles.xml更改为
<style name="AppTheme" parent="android:Theme.Holo.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>
@颜色/原色
@颜色/原色暗
@颜色/颜色重音
在清单中:
将活动主题更改为:
<activity
android:theme="@styles/AppTheme
....
使用自定义主题
<style name="CustomTheme" parent="Theme.Holo.Light.NoActionBar">
<!-- Customize your theme here. -->
</style>
并将其应用于您的舱单中
<application
android:theme="@styles/CustomTheme"
尝试将其放在您的styles.xml中
并将主题应用于您的应用程序
将您的all styles.xml文件屏幕截图张贴在此处。您可以发布您的崩溃的堆栈跟踪吗?如果你正在使用AppCompat,那么你的应用程序主题必须继承AppCompat主题。爱你,兄弟!如果我从activity而不是appcompat继承,它会起作用。谢谢Curtisloewc您可以在这里发布日志吗
<application
android:theme="Theme.Holo.Light.NoActionBar"
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>