I've got a core-plot graph that I display on a view and I need to add some UILabels to the bottom of the view. So, I found out that the 0,0 is in the lower left for this view instead of upper left. I believe this is due to the Quartz framework that core plot 开发者_如何学编程uses. When I add the UILables, the text in them is upsidedown. I need to rotate the text 180 degrees around the x-Axis in the middle of the text box. Can someone provide me with code that will do this?
Here's the code I have to create the 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];
Don't add subviews to the Core Plot hosting view. Add them to the parent view so they're siblings of the Core Plot view.
精彩评论