我在 Android Studio 中选择了 Material.NoActionBar.Fullscreen,我喜欢这个设计,但如果我启动我的应用程序,它会带有操作栏和明亮的背景。
在我选择 Material.NoActionBar.... 设计后,我的 style.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>
如何使用这种设计?
注意:我的 API 是 28,所以这应该不是问题
最佳答案
对不起! ,将代码更改为:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
getSupportActionBar().hide();
setContentView(R.layout.activity_main);
}
关于Android Studio 选择布局不起作用(Material.NoActionBar.Fullscreen),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53570551/