开发者

Inactive area after device rotation

开发者 https://www.devze.com 2023-01-02 14:07 出处:网络
I don\'t understand what\'s wrong in my very simple application with device rotation : I built my view with interface builder. (See screen capture here)

I don't understand what's wrong in my very simple application with device rotation :

  • I built my view with interface builder. (See screen capture here)
  • I specified <key>UIInterfaceOrientation</key><string>UIInterfaceOrientationLandscapeRight</string> in my info.plist file.
  • I had a (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {return YES;} in my root view controller.

The area on the left (shown in red on the capture), around 20 pixel width, keeps inactive (nothing append if I hit a button in this area). In fact the full screen is active only in portrait mode, in landscape right mode there is this 20 pixels width inactive area, in landscape left mode this inactive area is on the right, in portrait upside down mode this area is on the bottom.

I read lots of posts and documentation about UIView rotation, but I did not find anything to solve this problem (I tried to play with view.frame and view.bounds without any success).

Anybody has an idea ?

Thanks a lot.

Regards. Sébastien开发者_开发技巧.


One of your views is probably not autoresized correctly.

After rotation, it still has its old bounds of, for example, 320 x 460. Since views normally don't clip their contained views you don't see a difference.

Events on the other hand are only delivered to views that are contained in their superviews bounds.

0

精彩评论

暂无评论...
验证码 换一张
取 消