Always open a view in portrait mode in view in ipad?

蹲街弑〆低调 提交于 2019-12-08 04:15:28

I'm pretty sure you cannot use setOrientation anymore, since it is deprecated and apps have been declined for using it.

This may be an option for you:

http://www.iphonedevsdk.com/forum/iphone-sdk-development/33548-alternative-setorientation.html

It rotates the view using a transformation.

Okay so what you want to do is edit one of the functions in the view file. You want to set;

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

From return YES to return (interfaceOrientation == UIInterfaceOrientationPortrait);

Then your view should only be in potrait.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!