
修改一个旧项目的时候,设置iphone是竖屏、ipad横屏显示,
1.修改了这里
2 ipad设置了这
#pragma mark ———— ipad
- (BOol)shouldautorotatetoInterfaceOrIEntation:(UIInterfaceOrIEntation)interfaceOrIEntation
{
return (interfaceOrIEntation == UIInterfaceOrIEntationLandscapeleft || interfaceOrIEntation == UIInterfaceOrIEntationLandscapeRight);//UIInterfaceOrIEntationPortrait
}
- (NSUInteger)supportedInterfaceOrIEntations {
NSLog(@"让我旋转哪些方向");
return UIInterfaceOrIEntationMaskLandscape;
}
- (voID)dIDRotateFromInterfaceOrIEntation:(UIInterfaceOrIEntation)fromInterfaceOrIEntation{
if (fromInterfaceOrIEntation == UIInterfaceOrIEntationLandscapeleft) {
[AppVars standardVars].InterfaceOrIEntation=@"left";
}else {
if (fromInterfaceOrIEntation == UIInterfaceOrIEntationLandscapeRight) {
[AppVars standardVars].InterfaceOrIEntation = @"right";
}
}
}
屁作用不起!
最后原因是
rootVIEwController = [[RootVIEwController alloc] initWithNibname:nil bundle:nil];
navigation = [[UINavigationController alloc]initWithRootVIEwController:rootVIEwController];
// [self.window addSubvIEw:navigation.vIEw]; //旧版
self.window.rootVIEwController = navigation; // 改成 这样 OK 搞定
这个addSubvIEw: 坑了好几次了 这次记下啦
总结以上是内存溢出为你收集整理的关于ios横竖屏显示不正常的一个Bug修复全部内容,希望文章能够帮你解决关于ios横竖屏显示不正常的一个Bug修复所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)