ipad 應用 鎖定lanscape狀態(tài)不變,無論怎么旋轉,如何實現- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}還有(BOOL)shouldAutorotateToInterfaceOrientation:UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}我用的是ios6
1 回答
PIPIONE
TA貢獻1829條經驗 獲得超9個贊
如果整個程序都要橫屏,plist中修改下最省事。
<key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationLandscapeLeft</string> </array>
或者代碼中viewcontroller加,
- (BOOL)shouldAutorotate
{ return NO;
}
- (NSUInteger)supportedInterfaceOrientations
{ return UIInterfaceOrientationMaskLandscapeRight;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{ return UIInterfaceOrientationLandscapeRight;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{ return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}- 1 回答
- 0 關注
- 189 瀏覽
添加回答
舉報
0/150
提交
取消
