webos后台图片更新问题
我的应用程序有一个首选项屏幕,其中具有更改背景颜色或主题的功能。为此,我使用不同颜色的 png 图像。当我进入主屏幕时,我根据首选项中选择的图像使用其他一些图像。为此,我在首选项屏幕的 deactivate() 方法中使用 CSS 更改背景图像。在模拟器中,它工作正常。当我在设备上安装应用程序并检查相同的情况时,它显示空白,然后它更改了主屏幕图像。
如何避免从首选项屏幕过渡到主屏幕时出现空白背景的情况?
My application has a preference screen which has a feature for changing the background color or theme. For that, I am using png images with different colors. When I go to the main screen, I am using some other image depending on the image selected in the preferences. To do that, I am changing the background image with CSS in the deactivate() method of the preference screen. In the emulator, it works fine. When I install the app on the device and check the same case, it shows blank, then it changed the main screen image.
How can I avoid the moment of blank background in the transition from preference screen to main screen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来图像加载需要一秒钟。您可以将图像精灵化在一起,以便它们始终保存在内存中,或者您可以在 JS 中创建一个新图像,并仅在加载图像时运行场景转换。
It sounds like the image is taking a second to load. You can sprite the images together so they are always held in memory, or you can create a new image in JS and only run the scene transition when the image is loaded.