I'm using a segmented control that has two segments.
So, I'm using the following code:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if (self.view == self.myFirstView)
return false;
else if (self.view == self.mySecondView)
return true;
}
This all works nicely, except for the following condition: If the user selects segment 2, and then rotates the phone, the view goes into landscape mode. Then, while still holding the phone in landscape mode, the user presses segment 1. This displays the first view in landscape mode (I only want this view to be displayed in portrait mode).
So, the question is, how do I show the first view, but reset the view orientation to portrait?
Any ideas?
在view1中,获取方向,如果是横向,则将其切换为portratit。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.