Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/111.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 是否可以将UIImage添加到CPTGraph?_Ios_Objective C_Uiimage_Core Plot - Fatal编程技术网

Ios 是否可以将UIImage添加到CPTGraph?

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

我正在尝试使用Core Plot将图像添加到图形中,我希望图像在拖动或挤压时随图形移动。我尝试了下面的代码,但没有成功。谁能告诉我怎么做

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;