设置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"]; 

 

posted @ 2016-11-03 15:40  御龙家园  阅读(4546)  评论(0编辑  收藏  举报