iphone - Can't get UITextField to autoshrink text -


i have uitextfield on table view cell, , when it's text becomes long font size decrease. want make clear talking uitextfield, not uilabel or uitextview. reason because have seen question pop several times , answers based on uilabel instead of uitextfield. example, asked "i can't uitextfield autoshrink" , answer "make sure it's numberoflines set 1". best of knowledge, uitextfield not have property , single line control.

i have tried:

  • in ib setting font system 14.0, minfontsize 7 , checking "adjust fit" box
  • in code in tableview:cellforrowatindexpath:
ptcell.name.font = [uifont systemfontofsize: 14.0]; ptcell.name.adjustsfontsizetofitwidth = yes; ptcell.name.minimumfontsize = 7.0;

but neither of these have worked. mean instead of text shrinking truncates tail.

does know missing? presumably should work because have seen other questions complaining doing when user not want to.

i had same problem. uitextfield stoped shrinking text when long, instead resized , grew outside 'bounds'.

the solution helped me set width constraint on given uitextfield. after did not grew anymore, instead text inside got smaller intended. (of course have set minfontsize , check "adjust fit" box in storyboard.)

i know it's kind of late, if else find question via google did...it might help.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -