我想插入UITextField
的text。
这可能吗?
最佳答案
重写 -textRectForBounds:
只会更改占位符文本的插入。要更改可编辑文本的插入,您还需要覆盖 -editingRectForBounds:
// placeholder position
- (CGRect)textRectForBounds:(CGRect)bounds {
return CGRectInset(bounds, 10, 10);
}
// text position
- (CGRect)editingRectForBounds:(CGRect)bounds {
return CGRectInset(bounds, 10, 10);
}
关于ios - UITextField 的文本插入?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6535541/