在模拟器Android Studio上工作的Splash屏幕,但在我的手机上没有

发布于 2025-01-31 02:03:11 字数 349 浏览 2 评论 0原文

我正在使用离子,电容器和Android来测试和进行应用。

我已经使用命令生成飞溅和图标图像:

ionic cordova resources android

我构建项目npm run build

在Android Studio NPX CAP上启动项目

我在启动应用程序时, Splash屏幕在Android Studio的仿真器上很好地显示。但是,当我在手机上启动时,选择用于飞溅的图像并不是它像溅起屏幕的图标图像一样的好处。

我正在为所有LIB使用最后一个版本(我已经启动了一个项目,并且在此领域很新)

I'm using ionic, capacitor and android to test and make an application.

I've generate splash and icon image with the command:

ionic cordova resources android

I build the project npm run build

I launch the project on android studio npx cap open android

When i launch the application the splash screen displays well on the emulator of Android Studio. But when i launch on my phone the image selected for the splash is not the good it is using like a icon image for the splash screen.

I'm using the last version for all the lib (i've started a project and i'm new in this field)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蘑菇王子 2025-02-07 02:03:11

我遇到了同样的问题。

创建的飞溅图像存储在Android项目中:Android/app/res/drawable/splash
检查那里的图像。就我而言,创建了一些用于暗模式的图像,只是将应用程序图标放在黑色背景上。

当我的仿真器处于光模式时,它显示了正确的图像,但是在我的真实设备上,我使用了暗模式,因此使用了错误的图像。

我只是删除了这些深色模式图像,因此它总是拍摄光模式图像。

I had the same problem.

The created Splash Images are stored in the android project: android/app/res/drawable/splash
Check the images in there. In my case, there were somehow images for dark-mode created, that just have the app icon on a black background.

As my emulator was in light mode it showed the correct image, but on my real device I use the dark mode and so it had used the wrong image.

I just deleted those dark-mode images, so it always takes the light-mode images.

第几種人 2025-02-07 02:03:11

根据官方资产文档,您必须在资源文件夹中添加Splash-night: https:/https:/ /www.npmjs.com/package/@capacitor/assets

You have to add splash-night to your resources folder, as per official assets documentation: https://www.npmjs.com/package/@capacitor/assets

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文