iOS开篇——UI之ProgressView(进度条)

创建ProgressView

    UIProgressView * progressView = [[UIProgressView alloc]initWithFrame:CGRectMake(50, 100, 200, 10)];
    
    progressView.progressViewStyle = UIProgressViewStyleDefault;
    /*
     typedef NS_ENUM(NSInteger, UIProgressViewStyle) {
     UIProgressViewStyleDefault,     // normal progress bar
     UIProgressViewStyleBar __TVOS_PROHIBITED,     // for use in a toolbar
     };
     */
    progressView.progress = 0;
    
    
    //走过的颜色
    progressView.progressTintColor = [UIColor redColor];
    
    //本身的颜色
    progressView.trackTintColor = [UIColor greenColor];
    
    
    [self.view addSubview:progressView];

使用中 progress值改变造成进度条往前走   

posted @ 2015-11-24 01:02  GXcoder  阅读(761)  评论(0编辑  收藏  举报