一,效果图。
二,工程图。
三,代码。
RootViewController.m
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. [email protected]"平面化的饼图"; //隐藏导航条 self.navigationController.navigationBarHidden=YES; CLMView *cv = [[CLMView alloc] initWithFrame:CGRectMake(0, 0, 320, 440)]; cv.titleArr = [NSArray arrayWithObjects:@"iphone", @"sybian", @"windowbile", @"mego",@"android",nil]; cv.valueArr = [NSArray arrayWithObjects:[NSNumber numberWithFloat:20],[NSNumber numberWithFloat:20], [NSNumber numberWithFloat:20],[NSNumber numberWithFloat:20],[NSNumber numberWithFloat:20],nil]; cv.colorArr = [NSArray arrayWithObjects:[UIColor yellowColor], [UIColor blueColor], [UIColor brownColor], [UIColor purpleColor] , [UIColor orangeColor],nil]; [self.view addSubview: cv]; }
时间: 2024-10-28 20:40:06