zhouxiang
zhouxiang

Reputation: 153

SCROLLVIEW minimum zoom size

guys.i'm new to iphone.i run the zoomingpdfview demo,everthing is fine,except that i don't want the pdf is zooming out smaller than the screen's size,or even very small.. i've tried many ways,but still can't. so,how can i achieve that goal?thanks in advance.,any advice will be gratefull.

Upvotes: 0

Views: 532

Answers (1)

deanWombourne
deanWombourne

Reputation: 38475

There's a property on a UIScrollView called minimumZoomScale. However, this isn't measured in pixels, it's measured as a factor of the size of the view.

You will need to calculate the min zoom yourself i.e.

// for a pdf width 230 and screen width 360 your min zoom would be 2.0
//     a pdf width 720 and screen width 360 your min zoom would be 0.5

// So, to set the zoom for a scroll view
[myScrollView minimumZoomScale:screenWidth / pdfWidth];

However, you might have to calculate this for each visible page - pdfs can have pages of different size :)

Upvotes: 1

Related Questions