BTSimpleRippleButton

https://github.com/balram3429/btSimpleRippleButton

This is a custom button for iOS with Ripple effect. It is simple to integrate & customizable component. Suppors callback using blocks.

这是一个自定义的button,带有波纹效果.这是一个很容易使用并定制的组件,支持block回调.

Requirements

  • Xcode 5 or higher Xcode 5以及以上
  • Apple LLVM compiler Apple LLVM 编译器
  • iOS 7.1 or higher iOS 7.1 及以上
  • ARC ARC

Demo

Build and run the BTSimpleRippleButton project in Xcode to see BTRippleButtton in action.

编译以及运行这个demo项目来看看效果.

Installation

  1. Drag the file btRippleButtton.h / btRippleButtton.m to your project. Alternatively you can add the folder btRippleButton to your project. 将btRippleButtton.(h/m)文件拖入到你的项目当中
  2. Maken an import statement for the file as #import"BTRippleButtton.h" . 引入头文件
  3. Add to your project the QuartzCore framework make an import statement for it. 添加QuartzCore framework框架

Initialization

To go with a simple initialization, use the below method. Provide an image, frame size, the target method & the sender view.

你可以进行简易的初始化,使用以下的方法,提供一张 image, frame size,以及目标

BTRippleButtton *rippleButton = [[BTRippleButtton alloc]initWithImage:[UIImage imageNamed:@"pin.png"]
andFrame:CGRectMake(144, 55, 32, 32)
andTarget:@selector(buttonTapped:)
andID:self]; [rippleButton setRippeEffectEnabled:YES];
[rippleButton setRippleEffectWithColor:[UIColor colorWithRed:240/255.f green:159/255.f blue:10/255.f alpha:1]];
[self.view addSubview:rippleButton];

Block based call back

For block based initialization to enable call back, use the below simple method.

基于block方式的回调,使用以下方法

BTRippleButtton *rippleButtonGreen = [[BTRippleButtton alloc] initWithImage:[UIImage imageNamed:@"author.png"]
andFrame:CGRectMake(110, 300, 99, 99)
onCompletion:^(BOOL success) { // add here more code to block
NSLog(@"I am from Block, execution."); }]; [rippleButtonGreen setRippeEffectEnabled:YES];
[rippleButtonGreen setRippleEffectWithColor:[UIColor colorWithRed:204/255.f green:270/255.f blue:12/255.f alpha:1]];
[self.view addSubview:rippleButtonGreen];

[翻译] BTSimpleRippleButton的更多相关文章

  1. 《Django By Example》第五章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者@ucag注:大家好,我是新来的翻译, ...

  2. 《Django By Example》第四章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:祝大家新年快乐,这次带来<D ...

  3. [翻译]开发文档:android Bitmap的高效使用

    内容概述 本文内容来自开发文档"Traning > Displaying Bitmaps Efficiently",包括大尺寸Bitmap的高效加载,图片的异步加载和数据缓存 ...

  4. 【探索】机器指令翻译成 JavaScript

    前言 前些时候研究脚本混淆时,打算先学一些「程序流程」相关的概念.为了不因太枯燥而放弃,决定想一个有趣的案例,可以边探索边学. 于是想了一个话题:尝试将机器指令 1:1 翻译 成 JavaScript ...

  5. 《Django By Example》第三章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:第三章滚烫出炉,大家请不要吐槽文中 ...

  6. 《Django By Example》第二章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:翻译完第一章后,发现翻译第二章的速 ...

  7. 《Django By Example》第一章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:本人目前在杭州某家互联网公司工作, ...

  8. 【翻译】Awesome R资源大全中文版来了,全球最火的R工具包一网打尽,超过300+工具,还在等什么?

    0.前言 虽然很早就知道R被微软收购,也很早知道R在统计分析处理方面很强大,开始一直没有行动过...直到 直到12月初在微软技术大会,看到我软的工程师演示R的使用,我就震惊了,然后最近在网上到处了解和 ...

  9. ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第一章:创建基本的MVC Web站点

    在这一章中,我们将学习如何使用基架快速搭建和运行一个简单的Microsoft ASP.NET MVC Web站点.在我们马上投入学习和编码之前,我们首先了解一些有关ASP.NET MVC和Entity ...

随机推荐

  1. js便签笔记(2)——DOM元素的特性(Attribute)和属性(Property)

    1.介绍: 上篇js便签笔记http://www.cnblogs.com/wangfupeng1988/p/3626300.html最后提到了dom元素的Attribute和Property,本文简单 ...

  2. ActiveMQ发布-订阅消息模式

    一.订阅杂志我们很多人都订过杂志,其过程很简单.只要告诉邮局我们所要订的杂志名.投递的地址,付了钱就OK.出版社定期会将出版的杂志交给邮局,邮局会根据订阅的列表,将杂志送达消费者手中.这样我们就可以看 ...

  3. tomcat启动(Ⅶ)请求处理--Processor.process(SocketWrapper<S> socketWrapper)

    tomcat启动(六)Catalina分析-StandardServer.start() 上一篇分析到:Http11NioProcessor.process(SocketWrapper<S> ...

  4. Windows 查看程序占用的端口

    一. 查看所有进程占用的端口  在开始-运行-cmd,输入:netstat –ano可以查看所有进程 二.查看占用指定端口的程序  当你在用tomcat发布程序时,经常会遇到端口被占用的情况,我们想知 ...

  5. 终于完成了-- github.com/salomon1184/METP

  6. maven环境搭建Myeclipse配置

    一.Maven的下载安装 准备工作: 1.安装环境:windows 2.需安装JDK,并配置环境变量(略) 3.Maven版本3.0.5 4.下载地址:链接:https://pan.baidu.com ...

  7. onkeydown事件

    <img src="images/hot.jpg" alt="" id="imgId" class="img1"/ ...

  8. HTML5本地存储localStorage、sessionStorage基本用法、遍历操作、异常处理等

    HTML5 的本地存储 API 中的 localStorage 与 sessionStorage 在使用方法上是相同的,区别在于 sessionStorage 在关闭页面后即被清空,而 localSt ...

  9. C#:ORM--实体框架EF(entity framework)(1)

    本文来自:http://www.cnblogs.com/xuf22/articles/5513283.html 一.什么是ORM ORM(Object-relational mapping),中文翻译 ...

  10. JQuery判断浏览器类型(IE, Firefox…)

        1 2 3 4 5 6 7 8 9 10 11 $(function() {     if ($.browser.msie) {         alert("这是一个IE浏览器&q ...