更新时间:2023-01-05 09:46:43
当UIWindow具有旧的3.5英寸尺寸时会发生这种情况。 (这也会让UIActionSheets显示在屏幕下方)。
This happens when the UIWindow has the old 3.5 inch dimensions. (It also will make UIActionSheets show up above the bottom of the screen).
我仍然不确定发生了什么,但似乎特别是如果UIWindow在xib中。
I'm still not sure what's going on, but it seems to happen especially if the UIWindow is in a xib.
我们采取的修复步骤:
添加到-application:didFinishLaunchingWithOptions:
Add to -application:didFinishLaunchingWithOptions:
self。 window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
或者,您可以设置xib到4英寸屏幕中UIWindow的模拟指标大小。这似乎也有效,即使在3.5英寸的屏幕上也是如此。
Alternately, you might set the Simulated Metrics size of the UIWindow in the xib to 4-inch screen. That seems to work too, even on a 3.5 inch screen.