且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Default-568h@2x.png是不够的;无法点击屏幕的下半部分

更新时间: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.

我们采取的修复步骤:


  1. 获取从xib中删除UIWindow,如果它存在。

  2. 添加到-application:didFinishLaunchingWithOptions:

  1. Get rid of the UIWindow from the xib, if it exists.
  2. 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.