I have two UIButtons in container (UIView). Both of them have the same options (except button title) :
But when I launch this app on iPhone 5S I get result as below :
My question is : Why first button have horizontally centered text and second doesn't ? I want both of them to center their titles horizontally.
Greetings, Paweł
Actually you first button is centered only because it has shorter words in the title. If you set the title from the second button to the first button, you will se the same result.
You need to set text alignment through the code to make the title centered:
[button.titleLabel setTextAlignment: NSTextAlignmentCenter];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With