I'm trying to draw a semi-transparent shape over an image.
I've got a UIView which has it's layer's contents set to the image, with a CAShapeLayer sub-layer who's path is set to the shape. There are a few of these UIViews inside a parent UIView, which is the zoom child of a UIScrollView.
Everything is fine on the iPhone, but when I zoom in on the iPad, the UIViews get quite large, and the CAShapeLayers disappear. The images display fine though. I guessed that the problem was a size issue, so I split the CAShapeLayers in two, so that there was a left and a right side. Now, they both get shown unless the user zooms in really far, for example while "un-pinching" beyond my maximum zoom, just before they bounce back.
Splitting up my CAShapeLayers further is doable, but a little fiddly. So, I've got a couple of questions:
- Is there a maximum size constraint for CAShapeLayers? Why does it not apply to the layer's image contents?
- Why are the CAShapeLayers re-drawing during a zoom pinch inside a UIScrollView? Shouldn't the whole zoom view (the UIScrollView's immediate child) be rasterised during the inch? How can I make it so?