首页 > 其他 > 详细

[翻译] WZFlashButton

时间:2015-01-12 23:41:52      阅读:398      评论:0      收藏:0      [点我收藏+]

WZFlashButton

技术分享

This is a custom button with flash-like effect. Inspired by Ripple Effect.

这是一个自定义的按钮,有着闪烁效果,灵感来自于 Ripple Effect

技术分享

Demo

Build the project and run, you will find there are four different kind of WZFlashButton.

编译并运行这个项目,你将会发现几种不同类型的WZFlashButton。

  1. Outer flash without text
  2. Outer flash with text
  3. Inner flash without text
  4. Inner flash with text

Usage

Inner Flash Button - 按钮里面的闪烁效果

WZFlashButton *innerFlashButton = [[WZFlashButton alloc] initWithFrame:CGRectMake(100, 200, 200, 60)];
innerFlashButton.backgroundColor = [UIColor colorWithRed:42.0f/255.0f green:62.0f/255.0f blue:80.0f alpha:1.0f];
[self.view addSubview:innerFlashButton];

Outer Flash Button - 按钮外面的闪烁效果

WZFlashButton *outerRoundFlashButton = [[WZFlashButton alloc] initWithFrame:CGRectMake(100, 50, 50, 50)];
outerRoundFlashButton.buttonType = WZFlashButtonTypeOuter;
outerRoundFlashButton.layer.cornerRadius = 25;
outerRoundFlashButton.flashColor = [UIColor colorWithRed:240/255.f green:159/255.f blue:10/255.f alpha:1];
outerRoundFlashButton.backgroundColor = [UIColor colorWithRed:0 green:152.0f/255.0f blue:203.0f/255.0f alpha:1.0f];
[self.view addSubview:outerRoundFlashButton];

Set Click Block Callback - 设置按钮回调

innerFlashButton.clickBlock = ^(void) {
    NSLog(@"Click Done");
};

Example - 例子

It is very easy to use WZFlashButton while get amazing effect, you can take a look at the following demo 

使用起来非常的简单,你可以在编译的项目中查看demo。

[翻译] WZFlashButton

原文:http://www.cnblogs.com/YouXianMing/p/4220037.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!