SAHIL
SAHIL

Reputation: 431

UIButton not showing the text in iOS6

I am working with iOS6 and Xcode 4.5, I am getting an UI issue with some UIButton, some of the buttons title are not getting shown in my view.

In an older version of iOS everything works as expected.

Please see the following image. It's not showing the text "Button" while executing it on simulator

enter image description here

Upvotes: 3

Views: 2575

Answers (4)

Aleksandar Vacić
Aleksandar Vacić

Reputation: 4531

I had a similar case which I just resolved. I think I know what triggers the issue with auto-layout.

I assume that you have created one button, then copied across the row and then copied the rows down. When you do that, one of the auto-layout constraints that's set is "Baseline alignment" between the buttons.

The problem is if this constraints (it does not have to be user-level) remains between buttons which are not on the same horizontal position, meaning between buttons in different rows. So select the problematic button and check to see if you have this constraint. This was my case:

enter image description here

If you do, select it, upgrade to user-defined and delete it. All magically works afterwards.

Upvotes: 14

SAHIL
SAHIL

Reputation: 431

1Finally i solved my issue , actually iOS6 makes a default auto layout for view controller , through that it will align each component in the view .while i dont need the auto layout . so i just uncheck the auto layout in property which solved my issue .

enter image description here

Upvotes: 3

Echilon
Echilon

Reputation: 10254

Try changing the "line break" property of the button to anything other than truncate middle. It looks like it's being truncated to just an ellipsis.

Upvotes: 0

junaidsidhu
junaidsidhu

Reputation: 3580

clean your project and build again, if not work then restart the xcode and remove the old app from the simulator.

one thing more, if nothing work for you then remove the button and add new buttons.

Upvotes: 0

Related Questions