核心图,UIView和UILable会产生上下颠倒的文字

问题描述

|| 我在视图上显示了一个核心图,我需要在视图底部添加一些UILabel。因此,我发现0,0在此视图的左下角而不是左上角。我相信这是由于核心绘图使用的Quartz框架。当我添加UILable时,其中的文本是上下颠倒的。我需要将文本绕着文本框中间的x轴旋转180度。有人可以为我提供执行此操作的代码吗? 这是创建UILabels的代码:
int XLen = (self.view.frame.size.width-10) /3;
int YLen = 20;
int XPos = 10+([self.AllTheProbes count] % 3)*XLen;
int YPos = (([self.AllTheProbes count] / 3)+1)*YLen;
UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(XPos,YPos,XLen,YLen)];
myLabel.text = aProbe.sUserAssignedName;
myLabel.font = [UIFont fontWithName:@\"Courier\" size: 10.0];
    myLabel.textAlignment = UITextAlignmentLeft;
[self.view addSubview:myLabel];
    

解决方法

不要将子视图添加到Core Plot托管视图。将它们添加到父视图,使它们成为Core Plot视图的同级。     

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...