Search code examples
iosobjective-cautolayoutnslayoutconstraint

How to place UIView at top using Autolayout


I want to place UIView at the top of view controller using autolayout ,I have tried a lot, the UIView height is getting small in iPhone 4 and large in iphone 6 & above , how can i fix ? Attached image for reference


Solution

  • As i can understand from your question, If you need fix size of Subview on top then don't give bottom spacing constrain.

    Please set constrain as shown in below image.

    enter image description here