IOS:UItextfield已禁用 [英] IOS: UItextfield disabled
本文介绍了IOS:UItextfield已禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我们按下文本字段时,光标会出现在此文本字段中;但我不想让这个光标出现;
When we push on a textfield, a cursor appear in this textfield; but I don't want that this cursor appear; then I want make this textfield disabled, where you can't write inside, how can I do?
推荐答案
你可以设置启用属性/ userInteractionEnabled使用代码在ViewDidLoad()中将文本字段设置为否。
Can you set enabled property/userInteractionEnabled of text field to No in ViewDidLoad() using the code
textField.enabled = NO;
或
textField.userInteractionEnabled = NO;
这篇关于IOS:UItextfield已禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文