1.设置tetxField的内边距

[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”];

2.设置textfield的leftView 喂一个带有宽度的view

04-14 15:16