NoActionBar 仍在物理设备上显示
所以这是我的问题:我将 NoActionBar 放在我的主题上,当我在模拟设备中运行我的应用程序时,不会显示任何操作栏(所以一切都很好),但是当我在智能手机上安装并运行该应用程序时(如果是 galaxy S8 API 28)它有什么关系)操作栏仍然显示为什么这样?
这是 theme.xml 文件:
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.DTTREALESTATE" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/light_gray</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/red</item>
<item name="colorOnSecondary">@color/white</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">@color/light</item>
<!-- Navigation bar color -->
<item name="android:navigationBarColor">@color/light</item>
</style>
</resources>
我尝试使用 DarkActionBar 来查看智能手机上显示的内容,但它没有做任何事情,它只影响模拟设备......说实话,我完全不知道如何解决这。
So here is my problem : I put NoActionBar on my themes and when i run my app in an emulated device no action bar are shown (so everthing is fine) BUT when I install and run the app on my smartphone (galaxy S8 API 28 if it has anything to with it) an action bar is still displaying why so?
Here is the themes.xml file :
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.DTTREALESTATE" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/light_gray</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/red</item>
<item name="colorOnSecondary">@color/white</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">@color/light</item>
<!-- Navigation bar color -->
<item name="android:navigationBarColor">@color/light</item>
</style>
</resources>
I tried to use the DarkActionBar to see what would be display on my smartphone but it didn't do anything it only affect the emulated devices... To be honest I have ABSOLUTLY no idea how to solve this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请在两个 theme.xml 文件(白天和夜间)中添加这些行。
Please add these lines in both of themes.xml files (Day and night).
不要忘记在两个(夜间和普通)themes.xml 文件中更改它
Don't forget to change it in both (night and normal one)themes.xml files