简体   繁体   中英

Side-by-side constraints on Xcode storyboard

在此处输入图片说明

I am wanting to make it so that each of these images are displayed as such in my application. There are 5 images in total each labeled above. I have tried multiple constraints and the use of views, but I cannot get a solution to work. This unit as a whole is to be centered both vertically and horizontally on the screen. Also, I would like this to be done without code and only with constraints inside of the Xcode IDE.

First, position and size just the black cross image.

Now set the width and height constraints for all four images.

Finally, position each image. The first image is pinned to the top and left of the black cross image, the second is pinned to the top and right of the black cross image, and so on.

The following are just example values; it might make a little more sense to set the image height/width as a percentage of the black cross height/width, for example, and it's possible you might want to tweak the offset ( constant ) values:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM