[iPhone] Zooming & Dragging a PDF Inside a UIScrollView
[iPhone] Zooming & Dragging a PDF Inside a UIScrollView
- Subject: [iPhone] Zooming & Dragging a PDF Inside a UIScrollView
- From: Bob Barnes <email@hidden>
- Date: Fri, 22 May 2009 10:35:12 -0700
Hi,
I'm new to both Cocoa and iPhone so perhaps I've taken on
something too complicated for a beginner, but I'm trying to display a
PDF in a UIScrollView so that I can zoom/drag, etc. I've created a
view hierarchy with a main UIView (probably should be a
UIViewController, but that's another conversation) that has 3
subviews, a UIScrollView and 2 other UIView objects used to hold
custom controls. I've created a PDFView as a subclass of UIView and
add it as a subview of the UIScrollView. The actual drawing of the PDF
is done in the drawRect method of my PDFView object using the Quartz
2D PDF drawing calls. The zooming and dragging work, however, when I
scroll the view it drags too far, exposing the background of my view.
I had assumed that setting the contentSize of the UIScrollView to the
size of the zoomed PDF would prevent the PDFView from moving away from
the edge of the view, but I'm apparently missing something.
Can someone point me to some sample code that illustrates the
proper technique for drawing a PDF inside a scroller or perhaps offer
some suggestions on what I might be overlooking?
Bob
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden