ios - A static character prefix in UITextField -
is there built-in way add character prefix uitextfield screenshot below?

if no, best, straight-forward way accomplish this? thinking background property might able this.
simply adding gray uilabel on top of uitextfield trick:

note uilabel behaves background image, entered text stays on top:

update
additionally can add padding uitextfield using following code:
uiview *thepadding = [[uiview alloc] initwithframe:cgrectmake(0, 0, 5, 20)]; thetextfield.leftview = thepadding; thetextfield.leftviewmode = uitextfieldviewmodealways; this way text cannot cover prefix character.
adjust rect make working in situation.
Comments
Post a Comment