How to make UITextView’s height dynamically?

Photo by Andrew Neel on Unsplash

When you’re using UITextView to allow user write on something, it’s height is not being changed. Then, if you consider to use UITextField, it’s not allowed to be written down more than 1 row.

What you have to do for it is just one line of code.

yourTextView.isScrollEnabled = false

And then your UITextView will be resized just like this.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Fredric Cliver

Fredric Cliver

Majored in Physics, self-taught and worked in the IT industry as a Dev/Design/Planning for 11 years. And I had run my Startup for 3 years. I fancy a ☔️ 🇬🇧