[翻译] VBFPopFlatButton
2015-07-06 22:15
507 查看
VBFPopFlatButton
https://github.com/victorBaro/VBFPopFlatButton
Flat button with 21 different states and 2 types animated using pop.
Flat button 有21种不同的状态以及两种动画类型,动画用的是 pop 。
These are some examples of both types in different states:
以下是示例显示:
And here you can see them animated:
以下是动画示例:
How to use it
Best way is using Cocoapods
You can also clone and open example project. The class you have to use is VBFPopFlatButton(subclass of UIButton). You will also find VBFDoubleSegment which is just a helping class.
你可以使用Cocoapods,或者是clone到你的电脑中。
Here there is some example code on how to use the button:
以下是使用示例
Flat Rounded Style
Flat Plain Style
Requested feature added on 0.0.5 The designated initializer has changed to:
Adding the last 'animateToInitialState' boolean. Sending YES, the button will perform as in older versions (will animate on viewWillAppear from original type, represented as vertical line, to your initial type). Sending NO, the button will be presented using initial type with no animation on presentation.
In both cases, you can use the following method to animate the button from one state to the next:
This are the 20 types avaiable for the button:
以下是20种不同的动画类型:
More types are welcomed :D
For more info, visit my blog victorbaro.com
Apps using this control
I would love to know which apps in the App Store are using this control. Please, feel free to add your app :)
https://github.com/victorBaro/VBFPopFlatButton
Flat button with 21 different states and 2 types animated using pop.
Flat button 有21种不同的状态以及两种动画类型,动画用的是 pop 。
These are some examples of both types in different states:
以下是示例显示:
And here you can see them animated:
以下是动画示例:
How to use it
Best way is using Cocoapods
pod 'VBFPopFlatButton'
You can also clone and open example project. The class you have to use is VBFPopFlatButton(subclass of UIButton). You will also find VBFDoubleSegment which is just a helping class.
你可以使用Cocoapods,或者是clone到你的电脑中。
Here there is some example code on how to use the button:
以下是使用示例
Flat Rounded Style
//Example self.flatRoundedButton = [[VBFPopFlatButton alloc]initWithFrame:CGRectMake(100, 150, 30, 30) buttonType:buttonMenuType buttonStyle:buttonRoundedStyle animateToInitialState:YES]; self.flatRoundedButton.roundBackgroundColor = [UIColor whiteColor]; self.flatRoundedButton.lineThickness = 2; self.flatRoundedButton.tintColor = [UIColor flatPeterRiverColor]; [self.flatRoundedButton addTarget:self action:@selector(flatRoundedButtonPressed) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:self.flatRoundedButton];
Flat Plain Style
//Example self.flatPlainButton = [[VBFPopFlatButton alloc]initWithFrame:CGRectMake(200, 150, 30, 30) buttonType:buttonAddType buttonStyle:buttonPlainStyle animateToInitialState:NO]; self.flatPlainButton.lineThickness = 2; self.flatPlainButton.tintColor = [UIColor whiteColor]; [self.flatPlainButton addTarget:self action:@selector(flatPlainButtonPressed) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:self.flatPlainButton];
Requested feature added on 0.0.5 The designated initializer has changed to:
- (instancetype)initWithFrame:(CGRect)frame buttonType:(FlatButtonType)initType buttonStyle:(FlatButtonStyle)bStyle animateToInitialState:(BOOL)animateToInitialState;
Adding the last 'animateToInitialState' boolean. Sending YES, the button will perform as in older versions (will animate on viewWillAppear from original type, represented as vertical line, to your initial type). Sending NO, the button will be presented using initial type with no animation on presentation.
In both cases, you can use the following method to animate the button from one state to the next:
[flatRoundedButton animateToType:nextType];
This are the 20 types avaiable for the button:
以下是20种不同的动画类型:
typedef NS_ENUM(NSInteger, FlatButtonType) { buttonDefaultType, // Vertical line buttonAddType, // + buttonMinusType, // - buttonCloseType, // x buttonBackType, // < buttonForwardType, // > buttonMenuType, // 3horizontal lines buttonDownloadType, buttonShareType, buttonDownBasicType, buttonUpBasicType, buttonDownArrowType, buttonPausedType, buttonRightTriangleType, buttonLeftTriangleType, buttonUpTriangleType, buttonDownTriangleType, buttonOKType, buttonRewindType, buttonFastForwardType, buttonSquareType };
More types are welcomed :D
For more info, visit my blog victorbaro.com
Apps using this control
I would love to know which apps in the App Store are using this control. Please, feel free to add your app :)
相关文章推荐
- cvBoostNextWeakClassifier(翻译)
- VB获取CAD属性值
- CvBoostType
- 无法找到脚本*.VBS的脚本引擎解决办法
- 抛弃vboot不格盘用grub4dos+firadisk安装Ghost版XP到VHD,轻松RAMOS!
- Base64编码的vbs实现
- VBS版BrainFuck语言解释器
- 使用vbs脚本uft8toansi进行文件编码转换
- VB获取本机网卡类型、IP、MAC地址
- 关于在64位win7下运行Virtualbox安装系统时出错(提示VBoxDD.DLL错误)的解决方案。
- VB 常用函数
- excel使用正则表达式
- Excel VBA 基础知识——用代码读写目标单元格
- VBoxManage命令详解技术文章
- vb.net中利用双缓冲绘图技术解决listview加载数据闪烁的问题
- 这是 qq整人代码 VB
- 你是猪,,,vb经典代码 2015年07月02日 12:57:24 424人阅读 评论
- VB控件 与 引用或部件
- VBA基础学习
- Vb程序运行时出现"找不到工程或库"