Xcode 4.3 running application in Portrait
-
22-06-2021 - |
Question
Hi im createing a iOS application and i would like it to run on portrait all the time even when i turn it left/right i want it to stay the same here some images of all the settings relevant to portrait.
so thats all the stuff I've set so my question is how do i keep in in portrait even when i tilt it at the moment when it runs it opens in portrait but say if i turn it left it will rotate to landscape.
thanks in advance i will look forward to here from you.
Solution
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
Use this method to support only portrait mode
OTHER TIPS
Return YES for any orientations you support from this function.
(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow