设置textField的内边距

对textField设置内边距就不是用contentInSet来进行设置了

iOS UITextField 设置内边距

[self.yourTextField setValue:[NSNumber numberWithInt:5] forKey:@"paddingTop"];

[self.yourTextField setValue:[NSNumber numberWithInt:5] forKey:@"paddingLeft"];

[self.yourTextField setValue:[NSNumber numberWithInt:5] forKey:@"paddingBottom"];

[self.yourTextField setValue:[NSNumber numberWithInt:5] forKey:@"paddingRight"]; 

 

转载于:https://www.cnblogs.com/yulongjiayuan/p/6026874.html

你可能感兴趣的:(设置textField的内边距)