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: Dave Camp <email@hidden>
- Date: Fri, 22 May 2009 11:19:05 -0700
If all you want to do is display a PDF, just use a UIWebView. It will
display the PDF just like Safari with scrolling and whatnot and handle
everything for you.
Dave
On May 22, 2009, at 10:35 AM, 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?
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
_______________________________________________
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