首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >隐藏我的情节的核心情节注释

隐藏我的情节的核心情节注释
EN

Stack Overflow用户
提问于 2012-05-18 15:50:20
回答 1查看 585关注 0票数 0

我已经建立了一个以时间为x轴的散乱图。我在中午的时候在背景中画了一个小太阳图像:

代码语言:javascript
复制
CGRect imageRect = CGRectMake(0, 0 , 50, 50);
CPTBorderedLayer * imageLayer = [[CPTBorderedLayer alloc] initWithFrame:imageRect];
imageLayer.fill = [CPTFill fillWithImage:[CPTImage imageWithCGImage:[[UIImage imageNamed:@"SunIcon.png"] CGImage]]];
NSArray *anchorPoint = [NSArray arrayWithObjects:
                        [NSNumber numberWithInt:12*60*60], [NSNumber numberWithInt:100],
                        nil];
CPTPlotSpaceAnnotation *imageAnnotation1 = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:(CPTXYPlotSpace *)graph.defaultPlotSpace anchorPlotPoint:anchorPoint];
imageAnnotation.contentLayer = imageLayer;
[graph addAnnotation:imageAnnotation];
[graph addSublayer:imageLayer];

问题是太阳现在隐藏了我的阴谋。如何将图像发送到所有情节背后的背景中?

编辑:相反的情况是,我的右对齐y轴被图所隐藏。我能把这一层带到前面吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-05-22 01:32:44

将注释添加到绘图区域,然后将图像层移动到子层顺序的前面。

代码语言:javascript
复制
[graph.plotAreaFrame.plotArea addAnnotation:imageAnnotation];
[imageLayer removeFromSuperlayer];
[graph.plotAreaFrame.plotArea insertSublayer:imageLayer atIndex:0];
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10655809

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档