Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

franium

macrumors member
Original poster
Nov 18, 2010
34
0
Hi,
compared to a scrollable textview, will a no scrollable textview have a fixed size content?
Thanks
Fran
 

franium

macrumors member
Original poster
Nov 18, 2010
34
0
What do you mean by "fixed size content"? Because even a scrollable textview (normally) has a fixed frame size.

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.
As I don't know how long will be the text inserted by the user, is there a way to overcome this?
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
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!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.