2

I don't need to scroll inside a UITextView so disabling a scrolling property of my UITextView. It means UITextView's height is dynamic base on his content.

When I added more text in UITextView then text is not appearing. It is working with less content.

As per my observation if height of UITextView exceeds 8100 then it stops rendering but not sure about it.

enter image description here

here is a structure of storyboard.

Community
  • 1
  • 1
Urvish Patel
  • 175
  • 1
  • 11
  • **It means UITextView's height is dynamic base on his content.** -> What code you have written for this – Prashant Tukadiya Jan 07 '19 at 05:19
  • I just assign a more text. txtDummyTextView.text = """ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 15....""" – Urvish Patel Jan 07 '19 at 05:39
  • It will not automatically increase height of your textview or because of issue of constraint . You have to adjust height of your textview(i.e height constraint constant) according to text size. see this https://stackoverflow.com/questions/38714272/how-to-make-uitextview-height-dynamic-according-to-text-length – Prashant Tukadiya Jan 07 '19 at 05:43
  • you can used third party lib like [Growing Text Field](https://github.com/KennethTsang/GrowingTextView) – Jatin Kathrotiya Jan 07 '19 at 05:55
  • @PrashantTukadiya Will provide you demo app. – Urvish Patel Jan 07 '19 at 07:41
  • @PrashantTukadiya Here is mine code. https://github.com/urvishagile/TextViewDemo – Urvish Patel Jan 10 '19 at 14:24

1 Answers1

0

I understand your problem and please check below sample, i am modify your sample. This is working in my case.

Refer:- Updated Demo

Dhaval Patel
  • 716
  • 1
  • 10
  • 26