Position a View for drawing via renderInContext:
问题 I want to draw a UIView in my current CGGraphicsContext . I draw the UIView via renderInContext: , but it's not positioned correctly (always in the top left corner). I have all values of the UIView available for drawing the UIView . CGRect frame; CGRect bound; CGPoint center; CGAffineTransform transform; I currently set the position and rotation of the layer like this: CGContextTranslateCTM(context, frame.origin.x, frame.origin.y); CGContextRotateCTM(context, (CGFloat) atan2(transform.b,