문제

I have an application on AppStore that has portrait Mode on iPhone and on iPad it works on landscape. However i am getting reports that it shows portrait on iPad 1 thus destroyed overall View.

Why is iPad 1 specifically showing Portrait mode? The version of iPad is 5.1.1

도움이 되었습니까?

해결책

In ios 6, the methods for supporting interface orientation has been changed. For supporting both interface orientation in both version, we need to check the os version and write code acoordingly.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait); 
}

Support for new versions

- (NSUInteger)supportedInterfaceOrientations {

}

- (BOOL)shouldAutorotate {
   }

In my View Controller i have the following:

- (NSUInteger)supportedInterfaceOrientations {

}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {

}

- (BOOL)shouldAutorotate {

} 

다른 팁

Go and make sure ALL view controllers return the correct orientation modes they support. I've seen such behaviour in iOS 5 and if I recall correctly that was the reason.

I had a very similar from and I resolved it by changing the following code in AppDelegate.m-> applicationDidFinishLaunching:

 [self.window addSubview:self.viewController];

to

 [self.window setRootViewController:self.viewController];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top