草庐IT

editingRectForBounds

全部标签

ios - 在子类中实现 textRectForBounds 和 editingRectForBounds 后,UITextField 没有滚动到末尾?

我有一个UITextField子类,我正在其中实现以下方法:-(CGRect)textRectForBounds:(CGRect)bounds{returnCGRectInset(bounds,30,7);}-(CGRect)editingRectForBounds:(CGRect)bounds{returnCGRectInset(bounds,30,7);}由于这两种方法,当输入的文本大于UITextField的宽度时,UITextField不会滚动到末尾。有什么解决办法吗? 最佳答案 它不起作用只是因为您在UITextField