UIView没有正确自动化iPhone 3.5英寸和4英寸屏幕 [英] UIView not autoresizing correctly iPhone 3.5 inch vs 4 inch screen

查看:111
本文介绍了UIView没有正确自动化iPhone 3.5英寸和4英寸屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个UINavigationController,它的顶级UIViewController上有一个带UITabBar的UIViewController。 (它不是UITabBarController b / c我被告知Apple不希望你在UINavigationController上推送UITabBarController)。

I have a UINavigationController that has as its top UIViewController a UIViewController with a UITabBar on it. (It is not a UITabBarController b/c I am told that Apple does not want you to push a UITabBarController on a UINavigationController).

UITabBar控制3个UIViewControllers。当我在模拟器中运行时,3个UIViewControllers适用于3.5英寸屏幕或4英寸屏幕,具体取决于我如何在Interface Builder中使用模拟指标。但我无法在3.5英寸和4英寸屏幕上进行自动调整。它似乎是或者。

The UITabBar controls 3 UIViewControllers. When I run it in the simulator, the 3 UIViewControllers work for the 3.5 inch screen, or the 4 inch screen depending on how I use the simulated metrics in Interface Builder. But I can not get the autoresizing to work on both the 3.5 and 4 inch screen. It seems like it's either or.

这应该非常简单,因为它只是UIAutosizeRemaskFlexibileWidth和Height。我已经在代码中尝试了这个,并且还使用了Interface builder,并且由UITabBar控制的3个UIViewControllers永远不适合屏幕大小。我不应该为不同的iphone屏幕尺寸编写分支代码吗?

This should be very simple since it's just UIAutosizeRemaskFlexibileWidth and Height. I have tried this in code and also by playing with Interface builder, and the 3 UIViewControllers controlled by the UITabBar never fit the screen size. I should not have to write branching code for different iphone screen sizes should I?

推荐答案

在iOS 6中,struts和spring已经被名为Autolayout的东西取代。

With iOS 6, struts and springs have been replaced by something called Autolayout.

我建议你看一下这个链接: http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2

I suggest you take a look at this link: http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2

这篇关于UIView没有正确自动化iPhone 3.5英寸和4英寸屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆