相关疑难解决方法(0)

UIViewController返回无效帧?

当我在landscape模式下启动我的ViewController时(在调用viewDidLoad之后),我打印框架,它给了我纵向模式的帧大小.

这是一个bug有什么建议吗?

- (void)viewDidLoad
{
   [super viewDidLoad];

   NSLog(@"%@", NSStringFromCGRect(self.view.frame));
   // Result is (0, 0 , 768, 1024)
}
Run Code Online (Sandbox Code Playgroud)

landscape uiviewcontroller ios

38
推荐指数
1
解决办法
2万
查看次数

我的自我观点有错误的尺寸

我的观点有错误的维度.我正在运行景观,但视图报告纵向尺寸"查看宽度= 768.000000高度= 1024.000000"任何想法如何解决?我玩过我试过的自转器

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft|| interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
Run Code Online (Sandbox Code Playgroud)

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
}
Run Code Online (Sandbox Code Playgroud)

它在视图上看起来很好,但尺寸确实与我的应用程序混乱.

autosize uiview autorotate ios

8
推荐指数
1
解决办法
3077
查看次数

标签 统计

ios ×2

autorotate ×1

autosize ×1

landscape ×1

uiview ×1

uiviewcontroller ×1