gpt4 book ai didi

android - apply splash give me error 您需要在此 Activity 中使用 Theme.AppCompat 主题(或后代)

转载 作者:行者123 更新时间:2023-11-29 17:27:08 26 4
gpt4 key购买 nike

在 23 中,我们默认定义了这些样式,现在我必须以全屏启动启动

vlue/样式文件

 <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>

<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>

<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

v21样式文件:

 <style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>

list :

 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:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".User_MainInterface"
android:label="@string/title_activity_user__main_interface"
android:theme="@style/AppTheme.AppBarOverlay"></activity>

请帮我尽快解决这个问题

最佳答案

如果您在实现新的 SplashScreen API 时遇到此错误对于 Android 12 ,不要忘记安装SplashScreen:

SplashScreen splashScreen = SplashScreen.installSplashScreen(this);

不要忘记在 setContentView() 之前添加。

关于android - apply splash give me error 您需要在此 Activity 中使用 Theme.AppCompat 主题(或后代),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34261429/

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