CGContextDrawImage and UIScrollView

Discussion in 'iOS Programming' started by arnieterm, Nov 26, 2009.

  1. macrumors regular

    Joined:
    Aug 28, 2008
    #1
    Hi
    In my iphone application, I have a UIScrollView wherein I am adding UIView dynamically. As I have to draw a chart in each UIView so as a part of this I am using CGContextDrawImage inside the drawRect method of UIView.
    My problem is that the background image appears only in case of first UIView added. In subsequent UIViews the image does not appears
    I am not able to get what is happening as same code is executing again for subsequent views.

    Code:
    UIImage* img = [ UIImage imageNamed:@"bg_graph.png"];
    	CGContextDrawImage(context, self.frame, img.CGImage);				
    
    Thanks
    Arnieterm
     

Share This Page