简体   繁体   中英

how to indent a space between image and text in UITextField

I am trying to add a space between the text that user is going to type and an UIImage in a text field . Can any one please help me .

If you talk about leftView and rightView , you can create subclass of UITextField and override follow methods :

- (CGRect)leftViewRectForBounds:(CGRect)bounds;
- (CGRect)rightViewRectForBounds:(CGRect)bounds;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM