我试图使 android 12 启动屏幕的背景使用 @android:color/system_neutral1_900 作为背景,但正如我所看到的,颜色仅在启动屏幕之后加载。有什么办法可以在启动屏幕上使用它吗?
<style name="Theme.App.SplashScreen" parent="Theme.SplashScreen">
<!-- Set the splash screen background, animated icon, and animation duration. -->
<item name="windowSplashScreenBackground">@android:color/system_neutral1_900</item>
</style>
Run Code Online (Sandbox Code Playgroud)
颜色不会出现,它使用默认的灰色。我还尝试了其他 system_ 颜色,出现了相同的结果。使用 @android:color/black 或十六进制颜色可以。
自从 Android 12 的新 Android Splash Screen API 开始,在显示闪屏时后退按钮不再响应,看起来 UI 线程已完全接管,我无法重新启用后退按钮,这是一个问题,例如,如果用户不小心打开应用程序,他通常会单击后退按钮,应用程序关闭后问题就会立即解决(或者至少这是我的应用程序在这个新 API 之前的行为),但现在这是一个糟糕的用户体验。
所以我想知道您是否找到了解决此问题的方法并在加载数据时显示启动屏幕时启用“后退”按钮?
我测试了很多教程并下载了源代码,但在所有教程中,后退按钮都没有响应。
例如这个:https: //github.com/philipplackner/SplashScreenAndroid12
感谢您的帮助,非常感谢。
使用 Splash Screen API 时是否可以在启动屏幕中的徽标中添加文本?我在 Theme.SplashScreen 中没有找到任何有关“文本”的属性。
<style name="Theme.App.Starting" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/black_accent</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/circle_orange</item>
<item name="windowSplashScreenAnimationDuration">200</item>
<!-- Set the theme of the Activity that directly follows your splash screen. -->
<!-- Required -->
<item name="postSplashScreenTheme">@style/Theme.MyApplication</item>
</style>
Run Code Online (Sandbox Code Playgroud) 我对这个主题做了很多搜索,但一切都是徒劳的。我正在为我的 Android 应用程序引起轰动,但问题是图像在不同屏幕上会扭曲。我已经阅读了谷歌的“支持多屏幕”文章,但它仍然不起作用。请告诉我必须放在 ldpi、mdpi、hdpi 和 xdpi 文件夹下的图像的大小?
我尝试了以下操作:替换了 ldpi、mdpi、hdpi、xhdpi 文件夹中的图像。无论如何,如果我能够完美地为纵向模式设置图像,那么在横向模式下它会变得很奇怪。请帮助我伙计们。提前致谢。
Android SDK 的最新 Beta 版本在 Android 12(模拟器)上运行的每个应用程序上展示了默认启动屏幕,根据要求,我们已经有了自己的启动屏幕。
如果有人研究过它,请告诉我如何禁用/删除它(最好有示例代码)。