Is it possible to vertically align text inside labels with a “large” frame

前端 未结 8 1566
梦谈多话
梦谈多话 2021-01-01 11:58

In my application I have multiple tableviews with custom cells. Some of the text in the cells are spread out on between 2-4 lines so the height of the label is large enough

相关标签:
8条回答
  • 2021-01-01 12:48

    You can Simply Use A UITextView ,and Set its UserInteraction Enabled to No,And All of your problems will be solved!

    0 讨论(0)
  • 2021-01-01 12:51

    You can do it as follows

    1. Set your label's numberOfLines property 0 from IB

    2. Set your label's lineBreakMode as UILineBreakModeWordWrap (very very important)

    now whatever you set on the label just append few @"\n" to it..... ex.-

    [yourTextLabel setText:@"myLabel\n\n\n\n\n"];
    
    0 讨论(0)
提交回复
热议问题