IOS 开发中画扇形图实例详解

2020-01-18 22:35:17刘景俊

pieViewController.m文件


@implementation pieViewController

- (void)viewDidLoad {
  [super viewDidLoad];
  pieview *view=[[pieview alloc]init];
  view.radius=50;
  view.frame=CGRectMake(4, 150, 150, 300);
  [self.view addSubview:view];
  //view.backgroundColor=[UIColor clearColor];
  //模拟5秒后执行这个段代码
  dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
    view.radius=20;
  });
}
- (void)didReceiveMemoryWarning {
  [super didReceiveMemoryWarning];
  // Dispose of any resources that can be recreated.
}
@end

效果
ios开发,画扇形图,IOS,扇形图

5秒之后
ios开发,画扇形图,IOS,扇形图

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

 
注:相关教程知识阅读请移步到IOS开发频道。