Latest 2.0.0
Homepage https://github.com/huluo666/HJProgressView
License MIT Copyright 2016
Permission is granted to…
Platforms ios 7.0, requires ARC
Authors

http://stackoverflow.com/questions/22311516/uiprogressview-custom-track-and-progress-images-in-ios-7-1

一、主要功能:

UIProgressView+Radius 使用分类实现以下功能

1、修复UIProgressView在iOS7,iOS8.3上设置trackimage和ProgressImage无效Bug

2、UIProgressView设置进度圆角

3、快速简单设置UIProgressView高度,进度颜色等

HJProgressView 自定义ProgressView进度条,与系统使用方法,动画等一致,功能如上

HJProgressView

二、用法示例

优化:transform改变高度,会出现动画不自然,在iOS7.xx系统出现高度不准等Bug,故UIProgressView+Radius内部使用AutoLayout进行故UIProgressView高度设置
//progressView.transform=CGAffineTransformMakeScale(1.0, 8.0);//默认为2px,无法通过frame设置高度

#define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    //方式一 系统UIProgressView
        UIProgressView *progressView=[[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleDefault];
    progressView.frame=CGRectMake([UIScreen mainScreen].bounds.size.width/2-150, 60, 300, 20);
    [self.view addSubview:progressView];//由于使用AutoLayout需先addSubview然后设置高度等参数

    progressView.progressHeigt=20;
    [progressView setRadiusTrackColor:RGBCOLOR(231, 233, 238) progressColor:RGBCOLOR(255, 153,0)];
    [progressView setProgress:0.68 animated:YES];

    //方式二 自定义HJProgressView  注意:#import "HJProgressView.h"
    HJProgressView *progressView2=[[HJProgressView alloc]initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width/2-150, 100, 300,16)];
    progressView2.progressTintColor=RGBCOLOR(255, 153,0);
    [progressView2 setProgress:0.8 animated:YES];
    [self.view addSubview:progressView2];
}

Latest podspec

{
    "name": "HJProgressView",
    "version": "2.0.0",
    "summary": "u9996u6b21u63d0u4ea4",
    "description": "u7cfbu7edfu8fdbu5ea6u6761u81eau5b9au4e49uff0cu4e00u884cu4ee3u7801u5b9eu73b0u9ad8u5ea6uff0cu989cu8272u7b49u5c5eu6027u8bbeu7f6e",
    "homepage": "https://github.com/huluo666/HJProgressView",
    "license": {
        "type": "MIT",
        "text": "                   Copyright 2016n                   Permission is granted to...n"
    },
    "authors": {
        "Hu7f57": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/huluo666/HJProgressView.git",
        "tag": "2.0.0"
    },
    "source_files": [
        "Classes",
        "HJProgressView/**/*.{h,m}"
    ],
    "exclude_files": "Classes/Exclude",
    "requires_arc": true
}

Pin It on Pinterest

Share This