CATiledLayer: Render zoomable PDF Page - what are

2019-03-17 06:54发布

问题:

I made a little demo for viewing a PDF page which is zoomable. Basically, I MonoTouched the example at http://www.olivetoast.com/blog/2009/08/simple-uiscrollview-catiledlayer-pdf-example/.

You can find my version in my blog at http://www.wildsau.net/post/2011/02/28/Simple-UIScrollView-CATiledLayer-PDF-Example-%28MonoTouch-version%29.aspx

However, I have not been able to figure out what "LevelsOfDetail" and "LevelsOfDetailBias" properties of CATiledLayer are for. I can set any value combination and cannot spot a difference. Apple's help on the properties doesn't explain anything to me.

Can somebody please explain?

回答1:

This link has a pretty good explanation of levelsOfDetail. Here you can find a decent explanation of levelsOfDetailBias.



回答2:

levelsOfDetailBias is the number of levels which will be zoomed-in, or magnified.

levelsOfDetail is the total number of levels, counting zoomed-in, normal-size, and zoomed-out.

So if you only want to magnify, set them to the same value. If you only want to shrink, set levelsOfDetailBias to zero. If you want to both magnify and shrink, set levelsOfDetailBias somewhere in the middle.