//設(shè)置橫屏是否開啟 寫在AppDelegate.m里面
- (UIInterfaceOrientationMask)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
{
//[[UserInfoUtility sharedInstance]CanMaskLandscape]公共類保存這個(gè)參數(shù)作判斷
if ([[UserInfoUtility sharedInstance]CanMaskLandscape]) {
//開啟橫屏左右
return UIInterfaceOrientationMaskLandscapeRight|UIInterfaceOrientationMaskLandscapeLeft;
}
else
{
return UIInterfaceOrientationMaskPortrait;
}
}
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration {
//根據(jù)情況重繪界面Fram 設(shè)置屏幕寬高對(duì)調(diào)
switch (interfaceOrientation) {
case UIInterfaceOrientationPortrait:
//home健在下
break;
case UIInterfaceOrientationLandscapeRight:
//home健在右
break;
case UIInterfaceOrientationPortraitUpsideDown:
//home健在上
break;
case UIInterfaceOrientationLandscapeLeft:
//home健在左
break;
default:
break;
}
}
//針對(duì)webView設(shè)置LayoutSubviews
- (void)viewDidLayoutSubviews
{
[webView setFrame:CGRectMake(0, 0, kScreenwidth,kScreenheight)];
[super viewDidLayoutSubviews];
}
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者