-->

Default-568h@2x.png is not enough; can't tap b

2019-02-15 08:29发布

问题:

Possible Duplicate:
iphone 5 simulator - Cannot click on bottom of screen?

I have added a Default-568h@2x.png to my project, causing the letterbox areas to disappear. However, for this one project I am finding this insufficient: I can not tap any of the pixels on the bottom part of the screen, and full screen animations black out this area.

The letter box area has disappeared and the screen has expanded as expected:

I'm finding that everything under the first 960 pixels can't be tapped. Further, when animations are in progress I see a solid black bar under those 960 pixels, like this:

However, when the animation ends the black bar disappears again. But that area is still not clickable.

This project predates storyboards, and I'm unable to upgrade it to use storyboards for this release.

Does anyone know what's wrong?

回答1:

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).

I'm still not sure what's going on, but it seems to happen especially if the UIWindow is in a xib.

Steps we took to fix it:

  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]];

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.



标签: ios iphone-5