注意:此问题与正在运行的应用程序中的视图大小无关。严格地说,它与Interface Builder中画布上的Navigation Controller表示形式有关。
此图像说明了Interface Builder中的问题行为。
我还没有找到一种缩小导航控制器表示的方法。可以想象,一个iPad应用程序在许多Popover中包含许多导航控制器,这会使Storyboard画布变得非常拥挤。
请注意,为了更正导航控制器的根视图控制器的大小,我不得不将根视图控制器的“模拟度量标准”大小调整为“自由格式”,然后手动指定其根视图大小以匹配“容器视图”大小。
此图显示了导航控制器元素的期望行为。
此插图还提示了问题的原因。如果存在插入的视图控制器,则容器视图的大小不会细化到Navigation Controller元素。
我发现了3个类似的问题,但没有一个提供说明,也没有一个直接解决Xcode 5中仍然存在的问题。
I have found no answers on the Apple Developer Forums from the past 90 days.
So the question is, is there some control or setting in Interface Builder that I am overlooking that will solve my problem?
One of the answers to the question listed above provides a trick which involves adding an unused View Controller and Container View for every Navigation Controller, but that is unsatisfactory because adding cruft to the Storyboard is worse than having oversized Navigation Controllers.
Not sure if this answers your specific situation, but after much searching I discovered that (at least in Xcode 5.1) there's a "View Controller" panel in the storyboard sidebar with a "Simulated Size" entry - pick "Freeform" and set your width and height as you wish.
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句