我的应用程序被固定为横向模式,但viewDidLoad中时(),甚至viewWillAppear中(),下面的画像尺寸还是回到:如何让我的iPhone应用程序以横向模式启动?
self.view.bounds.size.width = 320.00
self.view.bounds.size.height = 480.00
这不是直到viewDidAppear()的实际尺寸景观结果。
self.view.bounds.size.width = 480.00
self.view.bounds.size.height = 320.00
我觉得这很奇怪。 为什么会发生这种情况!?我该如何解决这个问题?
你在你的根返回YES UIViewController的 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation方法? – 2012-02-09 23:35:21
我使用:return(interfaceOrientation == UIInterfaceOrientationLandscapeLeft);.我可以找到的每个配置都设置为横向。仍然没有改变。我怀疑它是iOS中的一个“功能”错误。 – 2012-02-10 02:54:18
我刚回去阅读Apple文档。 viewWillAppear:在任何动画配置为显示视图之前调用“。由于旋转是(可以)动画,这可能是为什么你看到未旋转的尺寸。所以我怀疑你是对的 - 这是一个“功能” – 2012-02-10 16:45:13