我有一个特定的UIViewController,我想锁定/强制它的方向为仅横向。在横向模式下锁定特定的UIViewController +强制横向模式
这是我做的,到目前为止,但没有任何成功....我试图得到这个工作对iOS 6的& 7.
我在做什么错?
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
// Return YES for supported orientations
return UIInterfaceOrientationMaskLandscape;
}
- (BOOL)shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations{
if([AppConst isIPad]){
return UIInterfaceOrientationMaskLandscape;
}
return UIInterfaceOrientationMaskLandscape;
}
//not ios6
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if([AppConst isIPad]){
return YES;
}
return interfaceOrientation == UIInterfaceOrientationLandscapeRight;
}
你如何呈现这个'UIViewController'?是指使用'UINavigtaion'? – Buntylm