Ios 是否可以将UIImage添加到CPTGraph?
我正在尝试使用Core Plot将图像添加到图形中,我希望图像在拖动或挤压时随图形移动。我尝试了下面的代码,但没有成功。谁能告诉我怎么做Ios 是否可以将UIImage添加到CPTGraph?,ios,objective-c,uiimage,core-plot,Ios,Objective C,Uiimage,Core Plot,我正在尝试使用Core Plot将图像添加到图形中,我希望图像在拖动或挤压时随图形移动。我尝试了下面的代码,但没有成功。谁能告诉我怎么做 CALayer *subLayer = [CALayer layer]; subLayer.contents = [UIImage imageNamed:@"image.png"]; subLayer.position = CGPointMake(100, 120); [_graph addSublayer:subLayer]; 使用打印空间注释: CPTB
CALayer *subLayer = [CALayer layer];
subLayer.contents = [UIImage imageNamed:@"image.png"];
subLayer.position = CGPointMake(100, 120);
[_graph addSublayer:subLayer];
使用打印空间注释:
CPTBorderedLayer *imageLayer = [[CPTBorderedLayer alloc] initWithFrame:imageFrame];
imageLayer.fill = [CPTFill fillWithImage:[CPTImage imageNamed:@"image.png"]];
NSArray *plotPoint = @[xCoordinate, yCoordinate];
CPTPlotSpaceAnnotation *imageAnnotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:plotSpace
anchorPlotPoint:plotPoint];
imageAnnotation.contentLayer = imageLayer;