chasseurmic/TWRProgressView
소개
A custom progress view to be used with masking images.
디자인 및 미디어측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalTWRProgressView
TWRProgressView
A custom view component that lets the user easily present a progress view masked with an image containing an alpha channel (i.e. PNGs). The view's progress can be animated; foreground and background colors can be customized as well as the duration of the animation.
Usage
Usage is easy.
Add the dependency to your Podfile:
platform :ios
pod 'TWRProgressView'
...
Run pod install to install the dependencies.
Next, import the header file wherever you want to use the progress view:
#import "TWRProgressView.h"
The progress view can be set up either via Interface Builder (XIB and Storyboards) by just setting TWRProgressView as the class of any UIView...
@property (weak, nonatomic) IBOutlet TWRProgressView *progressView;
...
UIImage *someImage = [UIImage imageNamed:@"image.png"];
[_progressView setMaskingImage:someImage];
...or programmatically with a pretty sweet one-liner:
CGRect progressViewRect = CGRectMake(0, 0, 100, 100);
UIImage *someImage = [UIImage imageNamed:@"image.png"];
TWRProgressView *progressView = [TWRProgressView progressViewWithFrame:progressViewRect
andMaskingImage:someImage];
[self.view addSubview:progressView];
TWRProgressView exposes the following methods that let the user customize color, progress and animation timing:
- (void)setProgress:(CGFloat)progress;
- (void)setProgress:(CGFloat)progress animated:(BOOL)animated;
- (void)setBackColor:(UIColor *)backColor;
- (void)setFrontColor:(UIColor *)frontColor;
- (void)setAnimationTime:(CGFloat)time;
Demo
Take a look at this video:
Requirements
TWRProgressView requires iOS 6.x or greater.
License
Usage is provided under the MIT License. See LICENSE for the full details.
관련 프로젝트 살펴보기
불러오는 중…
