【发布时间】:2015-04-28 01:59:03
【问题描述】:
我在我的xcode 项目中实现了corePlot。我正在尝试将legend 添加到另一个cell。
我可以将legend 添加到另一个单元格,但是当我这样做时,文本是颠倒的。
这是我的代码:
- (void)configureLegend
{
CPTGraph *graph = self.hostView.hostedGraph;
CPTLegend *theLegend = [CPTLegend legendWithGraph:graph];
// Add legend to graph
graph.legend = theLegend;
graph.legendAnchor = CPTRectAnchorRight;
CGFloat legendPadding = - (self.chartView.bounds.size.width / 8);
graph.legendDisplacement = CGPointMake(legendPadding, 0.0);
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:2 inSection:0]];
[cell.layer addSublayer:graph.legend];
这是我尝试过的:
theLegend.transform = CATransform3DMakeRotation(M_PI / 180.0f, 0, 1, 0);
}
这并没有做任何事情。结果哪里一样。为什么会发生这种情况,我怎样才能让文本正常显示,而不是颠倒?
编辑
当我将它添加为子层时,它是这样显示的:(上面写着:“第一”、“第二”。)
【问题讨论】:
标签: ios objective-c core-plot