开发者

How to forcefully make Device in landscape mode

I have and app in that app is running in potr开发者_如何学Pythonait mode and when i go to the next wiew i have to change the device orientation in landscape mode. Is there any way.


Put the below code in your controller class for having different orientation between UIViewControllers,

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

You could also try with below having different orientation between views.

[[UIDevice currentDevice] performSelector:@selector(setOrientation:) withObject:(id)UIInterfaceOrientationLandscapeRight];


No. [UIDevice setOrientation:] does that, but it's a private API.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜