PDA

View Full Version : Scrollable text view




suksmo
May 4, 2010, 01:26 PM
Hi,

I've got a lot of information going into a text view using the

blurb.text=@"....."

method. Problem is when this goes into the text view no scroll bar is created - so the text that rolls off the page cannot be viewed.

If I do it manually and put it in via interface builder theres no problem. Does anyone know how to solve this issue?



dejo
May 4, 2010, 01:39 PM
Make sure you have set the UITextView's contentSize (a property inherited from UIScrollView).

suksmo
May 4, 2010, 02:28 PM
Make sure you have set the UITextView's contentSize (a property inherited from UIScrollView).

I'll give that a go - seems to be a known issue - this solution didn't work -

http://www.iphonedevsdk.com/forum/iphone-sdk-development/18688-uitextview-not-scrolling-when-not-editable-3-0-a.html

suksmo
May 4, 2010, 02:32 PM
Make sure you have set the UITextView's contentSize (a property inherited from UIScrollView).

You are 100% right - this is a fun learning curve!

PhoneyDeveloper
May 4, 2010, 03:01 PM
Adding text to a text view should just work. It does for me. If the text is long enough then the view will be scrollable. Otherwise not. You don't need to do anything else.

If the frame of the textview extends outside the screen then you might have this problem. Also if the keyboard covers the bottom of the textview you might think you have this problem.