XCode 7 Autolayout Constraints: How to make 2 images stay horizontally in the center

后端 未结 2 470
轻奢々
轻奢々 2021-01-28 07:03

I\'m trying to position 2 UIImage views in the center of the screen, side by side. If it\'s just 1 UIImage, I can just set them to be vertically and horizontally center in the c

2条回答
  •  离开以前
    2021-01-28 08:09

    Take a view, put both the images inside that view. Add the constraints on those images with respect to the view you made (Edge to edge to the view). Now add the constraints on the view in respect of the super view. (Center vertically and horizontally). That's it!

提交回复
热议问题