首页 > 代码库 > textField设置输入文字距左边的距离

textField设置输入文字距左边的距离

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

textField设置输入文字距左边的距离