[翻译] WZFlashButton

简介:

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。

目录
相关文章
|
XML Java Android开发
[翻译]IAdaptable是什么?
IAdaptable在Eclipse里是一个非常重要的接口。对于Eclipse开发老手来说,它就像异常处理和抽象类一样寻常;但是对新手而言,它却令人感到困惑和畏惧。这篇文章将向你解释IAdaptable到底是什么,以及它在Eclipse里起到的作用。
1221 0
《Wir wilden weisen Frauen》翻译——<连载>
上周去逛图书馆,借了本德语原版的书。今天突然想起来了,就翻开来看。我不知道这本书是否有中文版的,不管有没有吧,我尝试翻译一下以提高自身的德语水平。每天花上一个半小时来翻译,我想应该不能翻译出来几句的。
810 0
|
缓存 API iOS开发
|
数据可视化 Perl
|
iOS开发 Android开发