简体   繁体   English

Xcode 12:iOS 14 Widget 在模拟器中全黑。 怎么修?

[英]Xcode 12: iOS 14 Widget all black in simulator. How to fix?

I want to add some iOS 14 widgets to my existing iOS app.我想向我现有的 iOS 应用程序添加一些 iOS 14 小部件。 When testing the widget in simulator it frequently happen, that the widget is not displayed correctly but is all black.在模拟器中测试小部件时,经常发生小部件显示不正确而是全黑的情况。 Both in the widget selection dialog and in the actual widget that is shown on the homescreen.在小部件选择对话框和主屏幕上显示的实际小部件中。

Re-running the app does not solve the problem.重新运行应用程序并不能解决问题。 In most cases the problem goes away when deleting the app and restarting the simulator.在大多数情况下,删除应用程序并重新启动模拟器后问题就会消失。 However, in some rare cases only deleting the simulator and adding a new one solved the problem.但是,在极少数情况下,只需删除模拟器并添加新模拟器即可解决问题。

So far this only happened when running the app in simulator while on a real devices everthing is OK.到目前为止,这仅在模拟器中运行应用程序时发生,而在真实设备上一切正常。 Since the problems goes away when switching the simulator, I assume that there is nothing wrong with my code.由于切换模拟器时问题消失了,我认为我的代码没有问题。 But of course I want to be sure, that this is not a problem of the app itself before submitting and publishing the app.但我当然想确定,在提交和发布应用程序之前,这不是应用程序本身的问题。

Is this a known problem in Xcode 12?这是 Xcode 12 中的已知问题吗? Am I doing something wrong?难道我做错了什么? Is there a known fix?有已知的修复吗?

So far I only found some posts from users who experienced this problem with other apps in early versions of iOS 14 beta.到目前为止,我只发现了一些来自在 iOS 14 测试版早期版本中使用其他应用程序遇到此问题的用户的帖子。 But these problems should have been fixed with later beta versions and should of course not happen any more in the final iOS 14 version.但是这些问题应该在以后的 beta 版本中得到解决,当然在最终的 iOS 14 版本中应该不会再发生了。

看起来像这里提到的模拟器上的已知苹果问题https://developer.apple.com/forums/thread/650782

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM