I have a UIView, with UIViews as subviews. Each of these sub-UIViews draws an image using drawRect, and may have a shadow using CALayer shadowOffset, shadowRadius, shadowOpacity.
This all works great, but I take a thumbnail picture of the top UIView using renderInContext. The shadows all show up at great distance from the sub-UIView.
This would be correct, because of the shadow offset, but I need the shadow offset to be less (or zero) during the renderInContext method, because the thumbnail context is a lot smaller than the UIView context.
I could renderInContext to a large context and then scale, but Instruments shows the large context memory usage jumps 3-4mb for that short time, and memory is tight.
Is there another way of achieving this? Or a speedy alternative to the renderInContext method for taking a thumbnail capture of a UIView hierarchy?
Edit: Instead of using the CALayer shadowOffset, I have tried using CGContextSetShadowWithColor inside drawRect: - this does work, but the shadows are being clipped, even though clipsToBounds is set to NO. Any ideas on this alternative?
Thanks.