开发者

Only support for landscape Interface orientation

开发者 https://www.devze.com 2023-01-27 01:06 出处:网络
I have application that uses landscape right orientation. In view controllers I use: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

I have application that uses landscape right orientation. In view controllers I use:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
  // Return YES for supported orientations
  return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

But, If user locks iphone or ipad to portrait orientation, screen is displayed as portrait, not landscape. Also, in info.pli开发者_开发技巧st file I defined only Right Landscape orientation as supported one.


Try setting the UIInterfaceOrientation key in your Info.plist to UIInterfaceOrientationLandscapeRight. That should force landscape right orientation on launch.


The problem was in function viewDidLoad where another view controller is pushed into navigation stack immediately. If pushing action is delayed then landscape rotation will start and proceed, and also desired view controller will be pushed properly with landscape orientation.

0

精彩评论

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