All Projects → iceyouyou → UUAmountBoardView

iceyouyou / UUAmountBoardView

Licence: MIT License
[iOS]带有数字(金额)滚动效果的UI控件

Programming Languages

objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to UUAmountBoardView

Uumarqueeview
[iOS]Customizable marquee view. #Marquee,MarqueeView,跑马灯,滚屏,上翻,左滑,多行,自定义
Stars: ✭ 295 (+697.3%)
Mutual labels:  view, scroll, customizable
Hhcustomcorner
Awesome library to customize corners of UIView and UIButton. Now you can customize each corner differently
Stars: ✭ 36 (-2.7%)
Mutual labels:  view, uiview, customizable
React Scrollbars Custom
The best React custom scrollbars component
Stars: ✭ 576 (+1456.76%)
Mutual labels:  scroll, customizable
Incrementproductview
Interesting concept of products incrementation
Stars: ✭ 262 (+608.11%)
Mutual labels:  view, customizable
Recyclerview Fastscroller
A fully customizable Fast Scroller for the RecyclerView in Android, written in Kotlin
Stars: ✭ 585 (+1481.08%)
Mutual labels:  view, scroll
Uuwaveview
[iOS]带有波形效果的UI控件,可自定义波形线条的数量、颜色、振幅、传播速度等各种参数。
Stars: ✭ 18 (-51.35%)
Mutual labels:  view, customizable
Slidablelayout
SlidableLayout is devoted to build a stable, easy-to-use and smooth sliding layout.
Stars: ✭ 385 (+940.54%)
Mutual labels:  view, scroll
Snappyrecyclerview
An extension to RecyclerView which will snap to child Views to the specified anchor, START, CENTER or END.
Stars: ✭ 178 (+381.08%)
Mutual labels:  view, scroll
Dry View
Complete, standalone view rendering system that gives you everything you need to write well-factored view code.
Stars: ✭ 124 (+235.14%)
Mutual labels:  view, uiview
Instagramactivityindicator
Activity Indicator similar to Instagram's.
Stars: ✭ 138 (+272.97%)
Mutual labels:  view, uiview
Inappviewdebugger
A UIView debugger (like Reveal or Xcode) that can be embedded in an app for on-device view debugging
Stars: ✭ 1,805 (+4778.38%)
Mutual labels:  view, uiview
Triangle
A (really) simple Swift 4 UIView class with a triangle and a diagonal line rendered and customizable in the storyboard (color, line width, direction)
Stars: ✭ 25 (-32.43%)
Mutual labels:  uiview, customizable
FatSidebar
Custom vertical button toolbar for macOS
Stars: ✭ 68 (+83.78%)
Mutual labels:  view
srraf
Monitor scrolling and resizing without event listeners.
Stars: ✭ 26 (-29.73%)
Mutual labels:  scroll
auto-fill-edit-text
This custom EditText can suggest and fill text defined before.
Stars: ✭ 26 (-29.73%)
Mutual labels:  view
Sharer
Arduino & .NET serial communication library to read/write variables and remote call functions using the Sharer protocol. Works on Windows, Linux and MacOS.
Stars: ✭ 21 (-43.24%)
Mutual labels:  board
plain-overlay
The simple library for customizable overlay which covers a page, elements or iframe-windows.
Stars: ✭ 28 (-24.32%)
Mutual labels:  customizable
FigmaConvertXib
FigmaConvertXib is a tool for exporting design elements from figma.com and generating files to a projects iOS .xib / Android .xml
Stars: ✭ 111 (+200%)
Mutual labels:  view
SBCardPopup
Card Popup UI for iOS
Stars: ✭ 66 (+78.38%)
Mutual labels:  view
MinTimetable
Customizable TimeTableView for Android
Stars: ✭ 26 (-29.73%)
Mutual labels:  customizable

UUAmountBoardView

Build Status

用于iOS,通过使用UITableView结合Pop动画的方式,创建带有数字(金额)滚动效果的UI控件。

Demo

UUAmountBoardView

使用方法

如果每个数字背景由图片创建,可使用带unitBgImage参数的init方法:

- (instancetype)initWithFrame:(CGRect)frame
                amountPattern:(NSString*)amountPattern
                     unitSize:(CGSize)unitSize
                  unitSpacing:(CGFloat)unitSpacing
                     textFont:(UIFont*)textFont
                    textColor:(UIColor*)textColor
                   textOffset:(CGPoint)textOffset
                  unitBgImage:(UIImage*)unitBgImage;	// 每个显示单位的背景图片

或者使用带unitBgViewMaker参数的init方法,通过指定一个UIView的构造Block,最大化定制背景内容:

- (instancetype)initWithFrame:(CGRect)frame
                amountPattern:(NSString*)amountPattern
                     unitSize:(CGSize)unitSize
                  unitSpacing:(CGFloat)unitSpacing
                     textFont:(UIFont*)textFont
                    textColor:(UIColor*)textColor
                   textOffset:(CGPoint)textOffset
              unitBgViewMaker:(void (^)(UIView *unitBgView))unitBgViewMaker;	// 构建每个数字单位背景View的回调

两种init方法中的参数说明如下:

/* 
 * frame: 仅x和y生效,Width和Height不生效,AmountBoardView会根据显示的位数及unitSize自动计算自身的宽高
 *        也可选用不带Frame的init方法,AmountBoardView支持AutoLayout布局。
 * amountPattern: 初始占位符
 * unitSize: 指定一个数字单位的Size
 * unitSpacing: 每个数字单位的间距
 * textFont: 显示内容的字体
 * textColor: 显示内容的字体颜色
 * textOffset: 显示内容的偏移量
 * unitBgImage: 每个显示单位的背景图片
 * unitBgViewMaker: 构建每个数字单位背景View的回调
 */

创建后使用以下方法设置显示数字或开启滚动效果:

- (void)setAmount:(NSString*)amount;        // 设置目标金额
- (void)countingToAmount;                   // 滚动到已设置的目标金额
- (void)countingToAmount:(NSString*)amount; // 滚动到指定目标金额

示例代码:

UUAmountBoardView *aView = [[UUAmountBoardView alloc] initWithFrame:(CGRectMake(20.0f, 80.0f, 0.0f, 0.0f))
                                                      amountPattern:@"000,000"
                                                           unitSize:CGSizeMake(20.0f, 25.0f)
                                                        unitSpacing:4.0f
                                                           textFont:[UIFont systemFontOfSize:20.0f]
                                                          textColor:[UIColor blackColor]
                                                         textOffset:CGPointZero
                                                        unitBgImage:[UIImage imageNamed:@"unitBgImage"]];
[aView setAmount:@"7,654,321"];
[aView countingToAmount];

UUAmountBoardView *bView = [[UUAmountBoardView alloc] initWithFrame:(CGRectMake(20.0f, 125.0f, 0.0f, 0.0f))
                                                      amountPattern:@"000,000"
                                                           unitSize:CGSizeMake(20.0f, 25.0f)
                                                        unitSpacing:4.0f
                                                           textFont:[UIFont systemFontOfSize:20.0f]
                                                          textColor:[UIColor blackColor]
                                                         textOffset:CGPointZero
                                                    unitBgViewMaker:^(UIView *unitBgView) {
                                                        unitBgView.layer.borderWidth = 0.5f;
                                                        unitBgView.layer.borderColor = [UIColor redColor].CGColor;
                                                        unitBgView.layer.cornerRadius = 4.0f;
                                                    }];
[bView countingToAmount:@"8,392,058"];

Compatibility

  • Requires ARC.
  • Supports iOS7+.

Additional

使用facebook/Pop实现数字滚动的效果。

License

UUAmountBoardView is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].