I tried to use a no scrollable textview inside a scrollview.
I think that the content size of textview is limited by the contentSize of the scrollview.
Actually, the
contentSize of a
UITextView is limited by its own setting, not any super-view. And remember that
UITextView is a subclass of
UIScrollView and, thus, that is how it inherits the
contentSize property. Also, make sure you understand the difference between the textview's
frame and
contentSize. If you haven't yet, be sure to read through the
Scroll View Programming Guide for iOS.
As I don't know how long will be the text inserted by the user, is there a way to overcome this?
I believe so, but it would be kind of tricky. You'd need to calculate the
contentSize such that all the content will fit without scrolling and then set the
frame accordingly. And if you hope to do this dynamically as the user is entering text into the textview, you have a whole new layer of complexity. Good luck!