How to get the graphics context of an UIView?
For example, I want to draw something directly to an UIView. I need an CGContextRef, but I don't want to make a new one since that would eat up too much memory. Can I obtain the CGContextR开发者_如何学运维ef from an UIView?
Only in the drawRect method:
UIGraphicsGetCurrentContext()
Outside of the redraw call, I do not believe so. I remember trying this myself a while ago. Sorry I can't be more specific, but I've not touched the iPhone SDK in months.
精彩评论