我有一個特定的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