Re: [iPhone] Zooming & Dragging a PDF Inside a UIScrollView
Re: [iPhone] Zooming & Dragging a PDF Inside a UIScrollView
- Subject: Re: [iPhone] Zooming & Dragging a PDF Inside a UIScrollView
- From: Scott Anguish <email@hidden>
- Date: Fri, 22 May 2009 15:40:19 -0400
The Scrolling example on the Apple developer site should get you
started.
On 22-May-09, at 1:35 PM, Bob Barnes wrote:
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?
you'd want to set the contentSize to be the size of the PDF normally,
not scaled. It'll handle it.
_______________________________________________
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