Hermann Klecker
Hermann Klecker

Reputation: 14068

UIButton Title does not appear or is cut - bottom most label only

I have a view with a number of buttons. The issue persists regardless whether I have 3, 4 or 5 Buttons. The one most bottom (with the highest y coordinate) does not show its tile. By playing around with the coordinates I found out that the title is sort of cut. See the screenshots for details.

All that I changed between those examples are the y coordinates of the buttons. It always happens to the button most down in the screen.

All on the same level is just fine

The lowest two appear empty

When there is just one that is the lowest, then this one appears empty

When the difference in y coordinate is smaller then the text height, then the text seems to be cut off somehow.

Additional information: I am using storyboard. The View hierarchy:

- UIView (The default empty UIView that is linked to the view controller's self.view)
--- UIScrollView
------ UIImage (The background image. Deleting it does not change anything)
------ UIButton
------ UIButton
------ UIButton
-------Lots of constraints, automatically generated.

Upvotes: 4

Views: 2046

Answers (2)

Bio
Bio

Reputation: 505

Try changing the title from Plain to Attributed for all the UIButtons that are suffering from this problem. Then you can change them back to Plain and it should solve this (odd) issue.

enter image description here

enter image description here

enter image description here

Upvotes: 5

Hermann Klecker
Hermann Klecker

Reputation: 14068

I did not nail it down to its reason. The way I solved it was deleting those 3 buttons and creating them again in IB (Storyboard).

Upvotes: 3

Related Questions