简体   繁体   English

ios7 iPad横向模式下的视图大小错误

[英]ios7 iPad wrong view size in Landscape mode

I have iPad application which uses iOS7 SDK with auto-layout. 我有一个iPad应用程序,它使用带有自动布局的iOS7 SDK。 my main view have a sub view which is a UITabBarController which programmatically creates it's view controller's (storyboard.instaniateViewController..). 我的主视图有一个子视图,它是一个UITabBarController,它以编程方式创建了它的视图控制器(storyboard.instaniateViewController ..)。

Inside the views - when i'm in portrait mode - everything is fine. 在视图内部-当我处于纵向模式时-一切都很好。 but when i move to landscape mode - the view's width is changed correctly, but the view's height remains as in Portrait mode. 但是当我转到横向模式时-视图的宽度已正确更改,但视图的高度仍保持与纵向模式相同。 The result is that my screen is truncated in a height. 结果是我的屏幕被截断了。

Any ideas why it happens? 任何想法为什么会发生? constrains seems fine. 约束似乎很好。 I can change it by programmatically change the vie's frame, but it doesn't seem right. 我可以通过编程方式更改vie的框架来更改它,但这似乎并不正确。

Thanks 谢谢

OK, i see what the problem was - somewhere up the view's hierarchy was defined: 好的,我明白了问题所在-在视图层次结构的上方定义了某个地方:

[viewController.view setAutoresizingMask:UIViewAutoresizingFlexibleWidth] 

and that meant that the height was not flexible of course. 这意味着高度当然不灵活。 the fix is easy once i saw it: 一旦我看到它,修复就很容易了:

[viewController.view setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 iOS CustomKeyboard在横向模式下尺寸错误 - IOS Customkeyboard getting wrong size in Landscape mode 在iPad横向模式UISplitViewController iOS上隐藏主视图 - Hide Master View on iPad landscape mode UISplitViewController iOS 当我在iOS7中的iPad中将视图从“纵向”旋转到“横向”或反之时,UITextfield应该不会调用ChangeRactersInRange - UITextfield shouldChangeCharactersInRange is not calling when i rotate the view from Portrait to Landscape or vice versa in iPad in iOS7 iPad Landscape View框架尺寸 - iPad Landscape View frame size iOS7:从横向模式加载子视图控制器时,查看会说话的肖像帧 - iOS7 : View talking portrait frame when loading child view controller from landscape mode 横向模式在iOS 8中是错误的-Xcode 6 - Landscape mode is wrong in iOS 8 - Xcode 6 仅限iOS7 iPad Landscape的应用程序,使用UIImagePickerController - iOS7 iPad Landscape only app, using UIImagePickerController iPad App横向模式损坏的iOS 8.3 - iPad App Landscape Mode broken iOS 8.3 为什么self.view.frame.size.width在iPad横向模式下显示768 - Why self.view.frame.size.width is showing 768 in iPad landscape mode iOS7上附件视图中的背景颜色错误 - Wrong Background Color in Accessory View on iOS7
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM