piaoyongren / core-plot

Automatically exported from code.google.com/p/core-plot
0 stars 0 forks source link

want to change the position of image but not supporting #180

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
hi i want to change the position and dimension of my mage but unable to do that 
.below is my code:
CPLayer *userLayer=[[CPLayer layer]initWithFrame:CGRectMake(-175, 335, 20,20)]; 
    UIImage *image1 = [UIImage imageNamed:[NSString stringWithFormat:@"outer1.png"]]; 
    userLayer.contents = (id)image1.CGImage; 
    //userLayer.position=CGPointMake(20,10); 
    //userLayer.frame = CGRectMake(0,0,userLayer.preferredFrameSize.width,userLayer.preferredFrameSize.height);
    [hostingView.hostedLayer addSublayer:userLayer];

    [userLayer needsDisplay]; 
    [hostingView.hostedLayer  needsDisplay]; 
    [userLayer needsLayout];

Original issue reported on code.google.com by monikadh...@gmail.com on 17 Jul 2010 at 8:43

GoogleCodeExporter commented 8 years ago
Set the frame after you add userLayer to the host layer. Your last three lines 
don't do anything. I think you meant setNeedsDisplay and setNeedsLayout, but 
those should be called automatically for you when you add the sublayer.

Original comment by eskr...@mac.com on 17 Jul 2010 at 12:46

GoogleCodeExporter commented 8 years ago
Hi,
I added the frame after addition of layer but still i am not able to change 
position.its not supporting.

Original comment by monikadh...@gmail.com on 17 Jul 2010 at 6:46