iOS - trying to rotate a text label and the label disappears

后端 未结 2 1290
予麋鹿
予麋鹿 2021-01-28 13:15

I\'m trying to rotate a label on my view 90 degrees. I\'ve tried the two following ways to do it and the label just disappears from the screen. I triple checked that the prope

2条回答
  •  遇见更好的自我
    2021-01-28 13:52

    It may simply be that the view's bounds have become too small for the text. When the text can't be fully displayed in label view in iOS, it simply disappears, rather than remaining on show. Perhaps it's a deliberate Apple policy to prevent apps shipping with clipped text and forcing the dev to fix ;)

    It sounds very much as though this is what is happening. You have said the text gets smaller as you rotate it, which indicates you have the shrink text to fit property set on the label view. This will shrink the text as the constraining view reduces in size. But the text will only shrink so much before it disappears.

    If the label view itself would seem to be big enough, also be sure to check the bounds of each parent view the label is contained in, up through the view hierarchy.

提交回复
热议问题