gpt4 book ai didi

ios - 向条形图、核心图添加标签

转载 作者:行者123 更新时间:2023-12-01 17:00:50 25 4
gpt4 key购买 nike

嗨,M 在添加标签时遇到问题..M 通过在循环内传递数组并设置 x &y 轴的位置来静态添加标签..m 传递彩色图像数组和标签数组..即使在这里 M 得到颠倒的标签和彩色图像。 .wat 问题可能是..down 是代码:

for( int i=0;i< [PieChartColorDescriptionArray count]; i++)
{
UIButton* blueButton=[UIButton buttonWithType:UIButtonTypeCustom];
[blueButton setFrame:CGRectMake(165+80,65+(40*i),10,20)];
[blueButton setTitle:@"" forState:UIControlStateNormal];
[blueButton setAutoresizingMask:UIViewAutoresizingFlexibleWidth ];
[blueButton setBackgroundImage:[UIImage imageNamed:[PieChartButtonImagesArray objectAtIndex:i]] forState:UIControlStateNormal];
[blueButton setAutoresizingMask:AUTORESIZEMASK];
[blueButton setUserInteractionEnabled:FALSE];
[self.view addSubview:blueButton];
[blueButton retain];
UILabel* loLabel1=[[UILabel alloc]initWithFrame:CGRectMake(178+80,50+(40*i),50,50)];
[loLabel1 setBackgroundColor:[UIColor clearColor]];
[loLabel1 setTag:101];
[loLabel1 setTextColor:[UIColor blackColor]];
[loLabel1 setTextAlignment:UITextAlignmentCenter];
[loLabel1 setAdjustsFontSizeToFitWidth:NO];
[loLabel1 setNumberOfLines:1];
[loLabel1 setFont:[UIFont systemFontOfSize:11]];
[loLabel1 setText:[PieChartColorDescriptionArray objectAtIndex:i]];
//loLabel1.transform=CGAffineTransformMakeRotation(-360.0);
[loLabel1 setAutoresizingMask:AUTORESIZEMASK];
[self.view addSubview:loLabel1];

[loLabel1 retain];

}

最佳答案

self.view Core Plot 托管 View ?如果是这样,请不要向其添加任何 subview 。相反,创建一个 View 层次结构,顶部有某种容器 View 。添加托管 View 以及您的标签和按钮作为容器 View 的 subview 。

关于ios - 向条形图、核心图添加标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7089045/

25 4 0