ios - Center 4 images with constraints autolayout -
I'm new to autolayout and I like how to focus these 4 images in all different devices like this Looks at the images I have tried to apply auto-configured obstacles, but then it will be at that distance and which is not fit on all devices. So my question is whether to focus all the images with the same distance I'm going to have obstacles on all the different images Need to apply?
Here's how my cell looks in the story:
image of the barrier option on Image 1:
In the image simulator:
/// MY TRY ////
Can you see the barriers I have added and the results?
Result:
Your approach is almost perfect, there is no shortage of images in it.
If you are t dynamic, the size of the images and the constant space between them Put the barriers on the image for the width to keep >, = 20
(or any other value, depending on your needs ) And keep an obstacle aspect ratio for it, then Ctrl-drag from UIImageView1
to UIImageView2
and set an interrupt for equal width that UIImageView1
to repeat UIImageView3
and UIImageView1
to UIImageView4
.
If you want images to always be set to your set size and Dynamically keep the spaces between the two if you have any The other approach is needed:
The trick here is so that it looks like UIImageViews has 3 empty UIViews in place:
- Set the barriers to the top for all the scenes
- Set the odds to the image Enter the details "
- Left and right for UIImageView1 and 4
- Set all UIImageViews restrictions for the same width
- UIImageViews of the same width Setting the Barriers for All UIViews Between A. 0
- Set the odds for all the distance between ideas
set to decrease the width of UIViews for & gt; = 0
This way the UIViewViews between UIImageViews creates dynamically and all the same width to resize
I hope you will get this idea.
Comments
Post a Comment