chipbk10
chipbk10

Reputation: 5955

Keep a sub view in the corner

I tried to keep a sub view in the corner of a UIViewController by using auto-layout (Horizontal Space, and Vertical Space), but always causes error of missing constraints (like view need constrains for Width, Height). Could you explain me why?

enter image description here

Note: I am using XCode 5, iOS7

Upvotes: 0

Views: 45

Answers (1)

Douglas
Douglas

Reputation: 2524

When you select the green box you will need to place more constraints on it. You already have the left and upper constraints. However, you still need to make constraints for the width and the height. At the bottom of the storyboard view where you selected the constraints you have, you will find another choice in that menu that says height and width. Select them as well and you should be fine. Views need at least four constraints so they know where to go!

Upvotes: 1

Related Questions