【发布时间】:2020-02-26 19:00:06
【问题描述】:
【问题讨论】:
标签: ios objective-c textfield padding
【问题讨论】:
标签: ios objective-c textfield padding
在你的自定义类中使用这个方法
- (CGRect)textRectForBounds:(CGRect)bounds {
return CGRectMake(bounds.origin.x + yourPading, bounds.origin.y + yourPading,
bounds.size.width - yourPading, bounds.size.height - yourPading);
}
- (CGRect)editingRectForBounds:(CGRect)bounds {
return [self textRectForBounds:bounds];
}
【讨论】: