I have a CPGraphHostingView to display a graph. I changed its theme to clear color, and add a UIImageView to the CPGraphHostingView in order to add an image as the background of the graph.
But then the image will give only the mirror image like copy of the original image. So when I am taking the screenshot of that view I’m getting the mirror image copy of the original view. How to solve this?
Don’t add any subviews to the
CPGraphHostingView. If you must use aUIImageView, make it a sibling of the hosting view (i.e., they are both subviews of the same parent).The easiest way to put an image behind a graph is to set the
fill.You can also create the image using
+imageWithCGImage:or+imageWithCGImage:scale:if you already have your background image loaded into aCGImageRef.