How to increase width of textfield according to typed text?

前端 未结 8 1929
失恋的感觉
失恋的感觉 2020-12-09 04:22

I need to increase a text field\'s width according to its content. When the user inputs text, then the textfield size should increase automatically. I have one close (X) but

8条回答
  •  长情又很酷
    2020-12-09 04:46

    Seems so frustrating that there is no direct way like there is "Autoshrink" to "Minimum Font size" for UILabel in IB itself. The "Adjust to Fit" in IB for a textfield is no good too.

    Why does Apple make us write all this boilerplate code, when a text field needs Autoshrink as much if not more than the UILabel!

提交回复
热议问题