how do you resize (visually, not programmatically) the detail view of a UISplitViewController in a storyboard?

10,058

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.

fwiw - I haven't found a way to resize things like nav or tab controllers.

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)

enter image description here

Share:
10,058
adriandz
Author by

adriandz

Updated on June 05, 2022

Comments

  • adriandz
    adriandz almost 2 years

    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.

    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 programmatically making it the detail view, instead of using a "replace" segue.

    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. Far-right view should be detail view sized

    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. Detail view sizing attribute seems to do nothing

  • adriandz
    adriandz almost 12 years
    Can you tell me exactly what your settings are in the Attribute Inspector, or upload a screenshot? I've tried Freeform with an explicit size and it does nothing. (Yes, I think you are understanding my question correctly.)
  • spring
    spring almost 12 years
    Added a screenshot. You have to select the View in order to set the size.
  • adriandz
    adriandz almost 12 years
    Thank you! Works perfectly. Really appreciate you taking the time to help me out.
  • mpemburn
    mpemburn over 11 years
    Took a bit to figure out where to find "Freeform": 1. Select the View Controller 2. Go to the Attributes Inspector (4th icon—the "shield") 3. Under "Simulated Metrics", change the "Size" drop-down from "Inferred" to "Freeform". Then, you can select the View of the View Controller and make the changes as shown above.
  • DataJock
    DataJock about 11 years
    This was GREAT and worked for a normal view controller, however I can't seem to figure out if there is a way to shrink the size of a Navigation Controller in which my view is embedded inside.
  • spring
    spring about 11 years
    @DataJock - I've never found a way to resize a Nav Controller - seems like one of the many rough edges of Storyboard.