简体   繁体   English

如何使我的uitextfield的某个区域不可编辑?

[英]How do I make a certain area of my uitextfield non editable?

我在uitextfield上插入了一个图像。像你在大多数登录界面看到的一个小图像。问题是用户可以输入该区域。如何使该区域不可编辑。所以用户只能输入那个形象

Seems that method - (CGRect)editingRectForBounds:(CGRect)bounds is what you are looking for UITextField Class Reference : 似乎那个方法- (CGRect)editingRectForBounds:(CGRect)bounds就是你要找的UITextField类参考

You should not call this method directly. 您不应该直接调用此方法。 If you want to provide a different editing rectangle for the text, you can override this method and return that rectangle. 如果要为文本提供不同的编辑矩形,可以覆盖此方法并返回该矩形。 By default, this method returns a region in the text field that is not occupied by any overlay views. 默认情况下,此方法返回文本字段中未被任何叠加视图占据的区域。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM