CSColorizedProgressView 1.0

CSColorizedProgressView 1.0

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2014 年 12 月

Charles Scalesse 管理。



  • 作者
  • Charles Scalesse

版本 1.0

CSColorizedProgressView 是一个进度视图,可以将灰度图像转换为全色图像。它的外观如下: CSColorizedProgressView Screenshots

基本用法

UIImage *image = [UIImage imageNamed:@"paris.png"]; // full-color image
CSColorizedProgressView *colorizedProgressView = [[[CSColorizedProgressView alloc] initWithImage:image] autorelease];
[self.view addSubview:colorizedProgressView];

[colorizedProgressView setProgress:0.75 animated:YES];

CSColorizedProgressView 还支持动画的完成块。这在进度达到 1.0 时特别有用,但您的应用程序 UI 应该在进度条视觉上完成之前不应响应。

colorizedProgressView.completionBlock = ^(CGFloat completedProgress) {
    if (completedProgress == 1.0) {
        NSLog(@"Progress completed!");
    }
};

设置说明

  1. CSColorizedProgressView.hCSColorizedProgressView.m 添加到您的项目中。
  2. 如果您使用 ARC,需要将 -fno-objc-arc 编译器标志添加到 CSColorizedProgressView.m

MIT 许可证

Copyright (c) 2013 Charles Scalesse.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.