Search code examples
iosxcodeautolayout

How to position multiple views on the same distance


I have the following View:

enter image description here

How to make so that they all are at the same distance between each other ? Preferably to be done using autolayout (not programmatically), but any answer would be great.

Currently stucked with Tue, Wed, Fri, Sat. Monday has a constraint Leading space to superview. Thursday is centered horizontally and Sunday has Trailing space to superview.

So basically need to position Tue and Wed so that distances between Mon, Tue, Wed, Thu are the same... (and same for Fri and Sat)


Solution

  • Check out this solution(fully based on autolayout in storyBoard): https://github.com/Petro-Lomaka/equalButtonsWidthAutoLayout