0

I have a textfield in a tableview 's last cell. The textfield is one line at beginning, when I input some text more than one line, I need the textfield change its height for me can view all text. How can I do this?

edit 1: I have try text view, it can input multiple line text, but how can I know when it from one line become two line? because I need resize cell height also.

edit 1 's answer UITextView Auto Height

Community
  • 1
  • 1
ZhouQi
  • 531
  • 1
  • 6
  • 16

1 Answers1

4

You can't do something like this with a UITextField because it's intended to be only a field and you can't change its height. Otherwise take a look to UITextView which can be set as you want, its frame etc... You only have to set it as editable so you can write text in it.

matteodv
  • 3,992
  • 5
  • 39
  • 73