swift - Height and Width of buttons not the same (ios) -


i have grid made of ios buttons (think sudoku). assigned each button have aspect ratio 1:1. further ensure equality, have made each button have width = height constraint set.

however, when @ buttons, of them have 44x45, while others have 44x44 (as expected).

is there constraint i'm missing or there workaround can guarantee buttons perfect squares.

this happening because have other constraints affecting views too. eg. might have put these in container view , specified container views width or made container view's width equal width of screen.

now when these square view fill container view, there space left eg 7 points. autolayout adds these 7 points making of squares wider 1 point.

this can fixed providing correct constraints container view.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -