LFProgressView 1.3.4

LFProgressView 1.3.4

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

Leo 维护。



  • 作者:
  • Light Design, Christian Di Lorenzo 和 Leo

已添加一些附加属性以绘制类似这样的东西

https://www.dropbox.com/s/dmyebdgkx8zb1j9/Screenshot%202014-06-13%2012.21.35.png

从 1.3.2 版开始增加了更多外观

    //  appearance
    [[LFProgressView appearance] setFlat:@YES];
    [[LFProgressView appearance] setShowStroke:@NO];
    [[LFProgressView appearance] setShowBackground:@YES];
    [[LFProgressView appearance] setShowBackgroundInnerShadow:@NO];
    [[LFProgressView appearance] setOuterStrokeWidth:@0];
    [[LFProgressView appearance] setProgressInset:@-1];
    [[LFProgressView appearance] setBorderRadius:@0];

    //  LFProgressView 1.3.2
    [[LFProgressView appearance] setTextColor:[UIColor whiteColor]];
    [[LFProgressView appearance] setTextAlignment:@(NSTextAlignmentLeft)];
    [[LFProgressView appearance] setShowTextShadow:@(YES)];
    [[LFProgressView appearance] setShowTextAlways:@(YES)];
    [[LFProgressView appearance] setFont:[UIFont fontWithName:@"Ubuntu-Bold" size:11]];
    [[LFProgressView appearance] setBackground:[UIColor colorWithRed:0.2 green:0.2 blue:0.2 alpha:0.50f]];
    [[LFProgressView appearance] setStripeWidth:@(10)];
    [[LFProgressView appearance] setStripeSlope:@(2)];

1.3.1 版以下

包含以下附加代码

        progress1.textAlignment = NSTextAlignmentLeft;
        progress1.textColor = [UIColor whiteColor];
        progress1.showTextShadow = YES;
        progress1.font = [UIFont fontWithName:@"Ubuntu-Bold" size:11.5];
        progress1.background = [UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:0.50f];
        progress1.stripeWidth = 10;
        progress1.stripeSlope = 2;

其他代码适用于原始 LDProgressView

        LDProgressView* progress1 = [[LDProgressView alloc] initWithFrame:CGRectMake(20, 41, self.view.frame.size.width-40, 20)];
        progress1.flat = @YES;
        progress1.showStroke = @NO;
        progress1.showBackground = @YES;
        progress1.showBackgroundInnerShadow = @NO;
        progress1.outerStrokeWidth = @0;
        progress1.progressInset = @-1;
        progress1.progress = 0.40;
        progress1.labelProgress = 0.0;
        progress1.borderRadius = @0;
        progress1.type = LDProgressStripes;
        progress1.color = [UIColor orangeColor];

        [progress1 overrideProgressText:@"test1"];
        [subview addSubview:progress1];

请查看以下关于 LDProgressView 的消息。


LDProgressView (v. 1.2)

Build Status

一个平面或渐变进度视图,具有简单的颜色设置器和可定制的选项,完全使用 Core Graphics 编写。

LDProgressView

变更日志

版本 1.2.1 发布! (3/14/2014)

  • 允许自定义覆盖进度文本
  • 允许禁用内部阴影,使用 showBackgroundInnerShadow 属性
  • 允许更改将应用于下一个进度更改的动画标志

版本 1.2 (12/05/2013)

  • 您现在可以通过以下属性创建轮廓进度视图。
  • 新属性: showBackground
  • 新属性: progressInset
  • 新属性: outerStrokeWidth
  • 新属性: showStroke

版本 1.1 (10/11/2013)

  • 新属性: borderRadius
  • 新进度填充类型: LDProgressStripes & LDProgressGradient

版本 1.0 (09/30/2013)

  • 初始发布

安装

手动

下载项目的 zip 文件,并将类 LDProgressViewUIColor+RGBValues 放入您的项目中。然后在您希望使用它的文件中简单地导入 "LDProgressView.h"。

如何使用

以下是上面的截图中所看到的示例

// default color, animated
LDProgressView *progressView = [[LDProgressView alloc] initWithFrame:CGRectMake(20, 130, self.view.frame.size.width-40, 22)];
progressView.progress = 0.40;
[self.progressViews addObject:progressView];
[self.view addSubview:progressView];

// flat, green, animated
progressView = [[LDProgressView alloc] initWithFrame:CGRectMake(20, 160, self.view.frame.size.width-40, 22)];
progressView.color = [UIColor colorWithRed:0.00f green:0.64f blue:0.00f alpha:1.00f];
progressView.flat = @YES;
progressView.progress = 0.40;
progressView.animate = @YES;
[self.progressViews addObject:progressView];
[self.view addSubview:progressView];

// progress gradient, red, animated
progressView = [[LDProgressView alloc] initWithFrame:CGRectMake(20, 190, self.view.frame.size.width-40, 22)];
progressView.color = [UIColor colorWithRed:0.73f green:0.10f blue:0.00f alpha:1.00f];
progressView.progress = 0.40;
progressView.animate = @YES;
progressView.type = LDProgressGradient;
progressView.background = [progressView.color colorWithAlphaComponent:0.8];
[self.progressViews addObject:progressView];
[self.view addSubview:progressView];

// solid style, default color, not animated, no text, less border radius
progressView = [[LDProgressView alloc] initWithFrame:CGRectMake(20, 220, self.view.frame.size.width-40, 22)];
progressView.showText = @NO;
progressView.progress = 0.40;
progressView.borderRadius = @5;
progressView.type = LDProgressSolid;
[self.progressViews addObject:progressView];
[self.view addSubview:progressView];

// stripe style, no border radius, default color, not animated
progressView = [[LDProgressView alloc] initWithFrame:CGRectMake(20, 250, self.view.frame.size.width-40, 22)];
progressView.progress = 0.40;
progressView.borderRadius = @0;
progressView.type = LDProgressStripes;
progressView.color = [UIColor orangeColor];
[self.progressViews addObject:progressView];
[self.view addSubview:progressView];

您也可以使用 UIAppearance 协议配置每个 LDProgressView,这可以在您的应用程序代理中完成。以下是一个此类配置的示例

[[LDProgressView appearance] setColor:[UIColor purpleColor]];
[[LDProgressView appearance] setBackground:[UIColor redColor]];
[[LDProgressView appearance] setFlat:@YES];
[[LDProgressView appearance] setAnimate:@YES];
[[LDProgressView appearance] setShowStroke:@YES];
[[LDProgressView appearance] setBorderRadius:@5];
[[LDProgressView appearance] setOuterStrokeWidth:@3];
[[LDProgressView appearance] setShowBackground:@NO];
[[LDProgressView appearance] setProgressInset:@5];

许可 (MIT)

版权所有 (C) 2013 Light Design [email protected]

本协议授予任何获取本软件及其相关文档文件(以下简称“软件”)副本的个人免费权利,无限制地处理软件,包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或出售软件副本的权利,并允许将软件提供给他人进行上述操作,前提是遵守以下条件。

以上版权声明和本许可声明应包含在软件的任何副本或主要部分中。

软件按“现有状态”提供,不提供任何形式的明示或暗示担保,包括但不限于适销性、适用于特定目的和不受侵犯的担保。在任何情况下,作者或版权持有人不应对任何索赔、损害或任何其他责任承担义务,无论这些责任是基于合同、侵权或其他原因,无论这些责任是由于使用软件、使用或软件的其他方式产生的。

Bitdeli Badge