How to disable select functionality in UITextView?

后端 未结 1 1230
悲&欢浪女
悲&欢浪女 2021-01-28 13:39

I want to create a text display area (either UILabel or UITextView) in my iPhone app which (1) allows scrolling and (2) does not allow selection. I have tried the following tech

相关标签:
1条回答
  • 2021-01-28 14:10

    Take option number 2, but set the numberOfLines property on your UILabel to 0. This will set the number of lines to 'unlimited' and prevent the vertical centring of the text.

    Don't forget to set the lineBreakMode property to UILineBreakModeWordWrap so that your text doesn't run off the side of the UILabel.

    0 讨论(0)
提交回复
热议问题