I have a custom background for an UITextField. But the first 20 pixels of the UITextField are taken by the design. The text should start 30 pixels from the left. I have searched quite a bit, but I couldn’t find it. I have seen things like overriding properties, but is that really necessary for something this basic?
I have a custom background for an UITextField . But the first 20 pixels
Share
I’ve seen two different solutions:
UIViewas aleftViewproperty of UITextViewtextRectForBounds:editingRectForBounds:– just return frame with insets appliedIMHO the second one is more elegant.
Example:
.h:
.m: