ios - A static character prefix in UITextField -


is there built-in way add character prefix uitextfield screenshot below?

enter image description here

if no, best, straight-forward way accomplish this? thinking background property might able this.

simply adding gray uilabel on top of uitextfield trick:

001 002

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

003

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

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -