How to create storyboard layout multiple views wit

2019-03-02 05:36发布

问题:

I have created header UIView on storyboard view controller, now I need to create 4 views like below colored image Into that UIview base view. It should show for all devices. Need to adjust auto layout using iOS.

回答1:

First set constraints to header view. Select header view and apply following constraints:

  • Leading, top, trailing space and Height = 80 (for example)

Once you apply constraints to header view then select all buttons at once :

Hope this can help



回答2:

Try this..

Now IOS 9 realse new feature stackview .

U can drag the stackview into your header view and add uiviews into it.

You can also change stackview's properties based on your project..