允许用户从UILabel中选择要复制的文本 [英] Allow user to select text from UILabel to copy
本文介绍了允许用户从UILabel中选择要复制的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个UILabel,但是如何让用户选择其部分文本。我不希望用户能够编辑文本,也不希望标签/文本字段具有边框。
I have a UILabel, but how can I allow the user to select a portion of it's text. I don't want the user to be able to edit the text nor the label/textfield to have a border.
推荐答案
UILabel
是不可能的。
你应该使用 UITextField
。只需使用 textFieldShouldBeginEditing
委托方法禁用编辑。
You should use UITextField
for that. Just disable editing using textFieldShouldBeginEditing
delegate method.
这篇关于允许用户从UILabel中选择要复制的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文