xcode 你如何在情节提要中调整 UISplitViewController 的细节视图的大小(在视觉上,而不是以编程方式)?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10902297/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how do you resize (visually, not programmatically) the detail view of a UISplitViewController in a storyboard?
提问by adriandz
In IOS5, with storyboards, suppose you have a UISplitViewController, which has some views that are set up as its master and detail views as normal. One of the detail views is set up as the initial detail view controller for the UISplitViewController, and thus its size, in the storyboard, is that of a normal detail view. Other detail views segue from this detail view, and because of the segue relationship, are also sized as normal detail views.
在 IOS5 中,使用情节提要,假设您有一个 UISplitViewController,它有一些视图,这些视图通常设置为主视图和细节视图。其中一个细节视图被设置为 UISplitViewController 的初始细节视图控制器,因此它在情节提要中的大小是普通细节视图的大小。其他细节视图从这个细节视图转移,并且由于转移关系,也被调整为普通细节视图。
And, of course, they all dynamically resize when you change the device's orientation. So far so good.
而且,当然,当您更改设备的方向时,它们都会动态调整大小。到现在为止还挺好。
Now suppose you add another UIViewController, which you are intending on using as the detail view for the UISplitView. In this case, however, you will be programmaticallymaking it the detail view, instead of using a "replace" segue.
现在假设您添加了另一个 UIViewController,您打算将其用作 UISplitView 的详细信息视图。但是,在这种情况下,您将以编程方式将其设为详细视图,而不是使用“替换”转场。
On the storyboard, this view will be full-sized, i.e. it will not look as though it is a detail view. This makes laying out the interface in the storyboard a problem.
在故事板上,此视图将是全尺寸的,即它看起来不像是详细视图。这使得在故事板中布置界面成为一个问题。
In the attached screenshot, you can see that the view on the far right is a full-size view. I want to make it detail view sized in the storyboard.
在附加的屏幕截图中,您可以看到最右侧的视图是全尺寸视图。我想让它在故事板中调整大小的详细视图。
How is this done? I've tried various combinations of sizes and options in the attributes inspector, but nothing seems to have much effect. The obvious choice would be "Size: Detail" in the "Simulated Metrics" section of the attributes inspector, but this appears to do nothing.
这是怎么做的?我在属性检查器中尝试了各种大小和选项的组合,但似乎没有什么效果。显而易见的选择是属性检查器的“模拟指标”部分中的“大小:详细信息”,但这似乎没有任何作用。
回答by spring
If I understand your question (resizing a viewController), I've done it through selecting Freeform
in the Size box, then clicking on the view and setting its size through the Inspector.
如果我理解您的问题(调整 viewController 的大小),我已经通过Freeform
在“大小”框中进行选择,然后单击视图并通过检查器设置其大小来完成此操作。
fwiw - I haven't found a way to resize things like nav or tab controllers.
fwiw - 我还没有找到调整导航或选项卡控制器等内容的方法。
EDIT: After selecting "Freeform", click on the View
, then set the size in the Identity Inspector tab as shown below (don't know tab name)
编辑:选择“自由格式”后,单击View
,然后在身份检查器选项卡中设置大小,如下所示(不知道选项卡名称)