iOS模拟器无法正确刷新 [英] iOS Simulator does not refresh correctly
问题描述
我尝试模拟一个非常简单的应用程序,该应用程序是在Xcode 9中创建的.我尝试在具有iOS 11.2的iPhone6的iOS模拟器中对其进行模拟.我还测试了其他具有相同结果的设备.
I try to simulate a very very simple application which I have created in Xcode 9. I try to simulate it in the iOS Simulator in an iPhone6 with iOS 11.2. I have also tested other devices with the same result.
在真实设备上,该应用程序可以正常运行.但是在模拟器上却没有.
On a real device, the app works as expected. But on the simulator it doesn't.
我希望单击该按钮后该按钮将变为橙色.表情符号应该消失了.相反,它变成了一些奇怪的阴影"外观.如果我等待,该按钮有时会在30秒钟后将其背景变为橙色.
I expect, that the button will become orange after I have clicked on it. and the emoji should disappear. Instead it changes into some strange "shadowed" look. If I wait then, the button will sometimes turn its background to orange after around 30 seconds.
我已记录了gif,以说明问题.
I have recorded a gif, to illustrate the problem.
http://www.giphy.com/gifs/l4pSUuBtN7aBVvbVe
更新:
这是另一个GIF: http://www.giphy.com/gifs/26DNe5B0vxIO6pHiw我向下拖动信息中心后,按钮就会刷新.
Here is another GIF: http://www.giphy.com/gifs/26DNe5B0vxIO6pHiw The button gets refreshed, as soon as i drag down the info center.
开发机器:Mac mini 2011,i5,SSD,8GB RAM,高Sierra
Development machine: Mac mini 2011, i5, SSD, 8GB RAM, high Sierra
希望有人可以帮助我.
更新:15.02.18 该问题仅在10或更高版本的iOS版本中出现.使用iOS 9.0版没有问题.期望那里没有表情符号...
UPDATE: 15.02.18 The problem only appears with iOS versions beginning from 10 and up. With iOS Version 9.0 there is no problem. Expect that there arent any emojis...
在此期间,我已向苹果提交了错误报告.但是我认为对此不会有任何回应.
In the meantime, i have filed a bug report to apple. But i think there will be no response on that.
认为其他人有相同的问题: https://forums.developer.apple.com/thread/96511
Looks that others having the same problem: https://forums.developer.apple.com/thread/96511
推荐答案
iOS 13更新:使用 Hardware>切换所有使用iOS 13或更高版本的设备的通话中状态栏
选项.所有设备的活动指示灯都消失了.幸运的是,通话状态栏不再更改布局大小.
iOS 13 UPDATE: Use the Hardware > Toggle In-call Status Bar
option for all devices with iOS 13 or higher. The activity indicator is gone for all devices. Fortunately, the in-call status bar no longer changes the layout size.
-
我终于找到了解决此问题的方法!
I have finally found a working workaround for this!
对于没有缺口的模拟器,请在启动应用程序时进行设置:
For simulators without the notch, set this when you launch the app:
[UIApplication sharedApplication] .networkActivityIndicatorVisible = YES;
Swift 4.1:
Swift 4.1:
UIApplication.shared.isNetworkActivityIndicatorVisible = true
,并且永远不要将其设置回 NO
.这将在状态栏中显示少量加载指示器,这将使模拟器持续处于活动状态并解决您的问题.
and never set it back to NO
. This will show the little loading indicator in statusbar, which will keep the simulator constantly active and will solve your issue.
请不要忘记确保您不在生产配置中使用它.
在状态栏(iPhone X)上带有槽口的仿真器不会显示活动指示器,但是您可以使用硬件">切换通话中的状态栏",因为通话中的图标正在设置动画,并且还会保持屏幕显示积极的.
Simulators with the notch in the status bar (iPhone X) don't show the activity indicator, but you can use Hardware > Toggle In-call Status Bar, because the in-call icon is animating and will also keep the screen active.
这篇关于iOS模拟器无法正确刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!