为什么文字颠倒了? [英] Why is the text upside down?

查看:106
本文介绍了为什么文字颠倒了?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将corePlot实现到我的xcode项目中。我正在尝试将图例添加到此处输入图像描述到另一个单元格。



我可以将图例添加到另一个单元格,但是当我这样做时,文字是颠倒的。



这是我的代码:



I implemented corePlot into my xcode project. I'm trying to add the legend enter image description here to another cell.

I'm able to add the legend to another cell, but when I do that, the text is upside down.

Here is my code:

- (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];
This is what I tried:

    theLegend.transform = CATransform3DMakeRotation(M_PI / 180.0f, 0, 1, 0);
}



没有做任何事。结果在哪里相同。如何才能正常显示文本,而不是颠倒?


That didn't do anything. The results where the same. How can I get the text to show normally, not upside down?

推荐答案

因为此代码是旋转。

because this code is a rotation.
CATransform3DMakeRotation(M_PI / 180.0f, 0, 1, 0);





您应旋转360度以获得更好的结果; - )



You should rotate for 360 degrees to get a better result ;-)


这篇关于为什么文字颠倒了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆