【问题标题】:Android Studio choose Layout don't work (Material.NoActionBar.Fullscreen)Android Studio 选择布局不起作用(Material.NoActionBar.Fullscreen)
【发布时间】:2018-12-01 12:00:03
【问题描述】:

我在 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,所以这应该不是问题

【问题讨论】:

  • 请不要使用设计标签;它正在被删除。

标签: android layout styles


【解决方案1】:

对不起! ,把代码改成这样:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
    getSupportActionBar().hide();
    setContentView(R.layout.activity_main);
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-26
    • 2020-08-31
    • 2017-08-28
    • 2022-12-30
    • 1970-01-01
    相关资源
    最近更新 更多