gpt4 book ai didi

Android 隐藏操作栏和工具栏

转载 作者:太空宇宙 更新时间:2023-11-03 13:51:19 25 4
gpt4 key购买 nike

在我使用的 list 中

minSdkVersion 14
targetSdkVersion 23

现在,我想隐藏主题:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ir.pishguy.simpleadvancepagedesign">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>


<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="@style/Theme.AppCompat.Light">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>
</style>

</resources>

但是我得到这个错误:

    Caused by: java.lang.IllegalStateException: You need to use a 
Theme.AppCompat theme (or descendant) with this activity.

最佳答案

在 Activity 中使用 getSupportActionBar().hide();

或者 getActivity.getSupportActionBar().hide(); 在 fragment 中。

关于Android 隐藏操作栏和工具栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34575057/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com