Subclassing UIScrollView for drawing w/o views

Posted by David Dunham on Stack Overflow See other posts from Stack Overflow or by David Dunham
Published on 2010-03-28T04:20:39Z Indexed on 2010/03/28 4:23 UTC
Read the original article Hit count: 396

Filed under:
|

I'm contemplating subclassing UIScrollView (the way UITextView does) to draw a fairly large amount of text (formatted in ways that NSTextView can't).

So far the view won't actually scroll. I'm setting contentSize, and when I drag, I see the scroll indicator. But nothing changes (and I don't get a drawRect: message).

An alternate approach is to use a child view, and I've done this. The view can be over 5000 pixels high, however, and I'm a bit concerned about performance on an actual device.

(The other approach, be like UITableView, would be a huge pain -- I'm "porting" Mac Cocoa code, and a collection of views would be a huge architecture change.)

I've done some searching, but haven't found anyone who is using UIScrollView to do the drawing. Has anyone done this and know of any pitfalls?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uiscrollview