zoukankan      html  css  js  c++  java
  • [翻译] EAColourfulProgressView

    EAColourfulProgressView

    效果:

    EAColourfulProgressView is a custom progress view where the current filling colour is generated between two colours, based on the current value.

    It takes advantages of IBDesignable and IBInspectable so that you can completely customize with without leaving the Interface Builder:

    EAColourfulProgressView是一个定制的进度条view,其进度当中的颜色介于两个颜色之间,当前颜色值由当前值决定。

    它使用了IBDesignable与IBInspectable,所以,你可以完全的定制他,不用IB也行:

    It gives you the possibility to update the current value by calling:

    你可以使用如下的方法来实时更新颜色值:

    /**
     *  This method updates the current value to the given one. It can
     *  animate the progress view filling size, as well as the background
     *  color change, if 'animated' is YES.
     *
     *  @param currentValue The new current value to be used.
     *  @param animated BOOL with YES if the update should be animated, NO otherwise.
     */
    - (void)updateToCurrentValue:(NSInteger)currentValue animated:(BOOL)animated;

    Installation Cocoapods

    Add this in your Podfile

    pod 'EAColourfulProgressView', '~> 0.1.0'
    

    Usage

    Set the Custom Class of a UIView to EAColourfulProgressView in Interface Builder, customize the available variables and see them being live rendered ;)

    在IB中,你将UIVIew的子类设置成EAColourfulProgressView,定制一下属性,然后就会像上图中显示的那样子了:)

    Future improvements

    • Any number of segments 任意数量的分段显示
    • Segment separators (loading like progress view) 分段显示风格(看起来像真正的进度条)
    • Performance improvements 改进
  • 相关阅读:
    BZOJ2243: [SDOI2011]染色(树链剖分/LCT)
    BZOJ2157: 旅游(LCT)
    BZOJ3510首都(LCT)
    BZOJ4530 [BJOI2014]大融合(LCT)
    BZOJ2631: tree(LCT)
    BZOJ2002: [Hnoi2010]Bounce 弹飞绵羊(LCT)
    BZOJ3282: Tree (LCT模板)
    [NOI2008]假面舞会(DFS)
    斜率优化dp练习
    BZOJ2049[Sdoi2008]Cave 洞穴勘测(LCT模板)
  • 原文地址:https://www.cnblogs.com/YouXianMing/p/4109828.html
Copyright © 2011-2022 走看看