Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Buttons are not perfectly equally as expected iOS Autolayout

I'm trying to make "Two Equal-Width Buttons" As it's described in Apple Auto Layout Guide.

https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/AutolayoutPG/ViewswithIntrinsicContentSize.html#//apple_ref/doc/uid/TP40010853-CH13-SW1

And it looks ok in preview of interface builder (Main.storyboard).But when I try to change devices i see that width is different on some devices. How can i fix that ? How can I make equal width of buttons for all devices by using constraints or another techniques?

Updated Examples:

width is ok

width is ok

width is not ok

width is not ok

Width is ok

Width is not ok

like image 481
Val Avatar asked Oct 28 '22 11:10

Val


1 Answers

There is not problem with the width of your buttons. Because of difference of 0.5 point between two buttons, it may not be showing you equal width.

Just check width of both button manually, there may not be difference between them, more than 1 point.

Look at this snapshots:

iPhone 5

enter image description here

iPhone 8

enter image description here

iPhone X

enter image description here

enter image description here

enter image description here

like image 62
Krunal Avatar answered Nov 12 '22 19:11

Krunal