How lock screen in iOS for it to have only portrait orientation?
问题 I have created an app with many views and I want to have some of them only in portrait orientation. I have coded this in .m file: -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return NO; } Do I need to do something else? May be in .h file? 回答1: Cleanest solution for me: Go to Info.plist file and for the "Supported interface orientations", remove every value except "Portrait (bottom home button)". 回答2: You just need to return a BOOL in that method