How to edit multiple constraints at once in Xcode Interface Builder

I have a UIButtons layout that looks like this:

enter image description here

The horizontal distance between the buttons is 8. I would like to change this to 4. Of course, I could change them one by one, for example:

enter image description here

But there are many buttons, and I really don't want to do this.

I tried to select a few buttons and then added a constraint on the horizontal space of 4, but that just adds the constraints. It does not update old restrictions. This creates conflicting restrictions with the old.

I did not see anything to solve this problem in the documentation "Editing automatic layouts" .

+5
source share
5 answers

Just use Command + click to select a few restrictions,

like gif

enter image description here

+6
source

One way is to create the simplest views, with each view width equal to the first. Set the button limit to the beginning and step-by-step addition. and if you change the first spacer width, it will change the entire width of the othes view.

+4
source

You have to do it one by one. There is no way to select all of them to change their values.

0
source

You just need to select all the buttons and navigate to where you want them, and then you just need to update the restriction.

Update restrictions

0
source

I agree with @Leo's answer and voted as well :)

Just adding to it, if someone would like to make it easier, he can use the filter parameter specified below the restrictions.

For example, to find all the leading restrictions, you can find the word "= leading" or "trailing =" for the final restrictions or another similar search string.

You can see this from GIF too.

enter image description here

0
source

Source: https://habr.com/ru/post/1233498/


All Articles