1

I've a collection view that has on its header some views as user inputs.

In one of them I've something like a Biography textField, but when I'm typing the text continues all the way to the left, and what I'm trying to achieve is that when the text reaches the visible end, it goes to a new like and so it increases its own height.

How can I achieve this?

header

I want the Bio text field to increase its height based on its text and not stay the same height and the text goes all the way long to the left.

Regards ;)

Ivan Cantarino
  • 3,058
  • 4
  • 34
  • 73

1 Answers1

1

UITextField is one-line only element. You can try UITextView instead

EDITED

I've never done this, but this thread seems to do something like dynamic size with UITextView

Vladyslav Zavalykhatko
  • 15,202
  • 8
  • 65
  • 100
  • Hmm... text view then wraps itself to the following line? Anyway how could I make its size dynamic so the following views stay at the bottom still? – Ivan Cantarino May 28 '17 at 13:11
  • it does. make its size dynamic, but following views still? it doesn't make sense for me. how many lines do you want to save for Bio field? – Vladyslav Zavalykhatko May 28 '17 at 13:13
  • It might have 2 lines 3 the most. The following views are programmatically anchored to the previous view bottom so the twitter view is anchored to the Bio view's bottom. My question is will it redesign itself of will I need to call layoutSubviews to redesign them? – Ivan Cantarino May 28 '17 at 13:16
  • Thanks for the tip ;) – Ivan Cantarino May 28 '17 at 13:46