[翻译] BTSimpleRippleButton
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
- Drag the file
btRippleButtton.h / btRippleButtton.mto your project. Alternatively you can add the folderbtRippleButtonto your project. 将btRippleButtton.(h/m)文件拖入到你的项目当中 - Maken an import statement for the file as
#import"BTRippleButtton.h". 引入头文件 - Add to your project the
QuartzCore frameworkmake 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的更多相关文章
- 《Django By Example》第五章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者@ucag注:大家好,我是新来的翻译, ...
- 《Django By Example》第四章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:祝大家新年快乐,这次带来<D ...
- [翻译]开发文档:android Bitmap的高效使用
内容概述 本文内容来自开发文档"Traning > Displaying Bitmaps Efficiently",包括大尺寸Bitmap的高效加载,图片的异步加载和数据缓存 ...
- 【探索】机器指令翻译成 JavaScript
前言 前些时候研究脚本混淆时,打算先学一些「程序流程」相关的概念.为了不因太枯燥而放弃,决定想一个有趣的案例,可以边探索边学. 于是想了一个话题:尝试将机器指令 1:1 翻译 成 JavaScript ...
- 《Django By Example》第三章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:第三章滚烫出炉,大家请不要吐槽文中 ...
- 《Django By Example》第二章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:翻译完第一章后,发现翻译第二章的速 ...
- 《Django By Example》第一章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:本人目前在杭州某家互联网公司工作, ...
- 【翻译】Awesome R资源大全中文版来了,全球最火的R工具包一网打尽,超过300+工具,还在等什么?
0.前言 虽然很早就知道R被微软收购,也很早知道R在统计分析处理方面很强大,开始一直没有行动过...直到 直到12月初在微软技术大会,看到我软的工程师演示R的使用,我就震惊了,然后最近在网上到处了解和 ...
- ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第一章:创建基本的MVC Web站点
在这一章中,我们将学习如何使用基架快速搭建和运行一个简单的Microsoft ASP.NET MVC Web站点.在我们马上投入学习和编码之前,我们首先了解一些有关ASP.NET MVC和Entity ...
随机推荐
- android学习-Toast的延迟时间
一般显示Toast都是一条语句够了 Toast.makeText(Context context, CharSequence text, int duration) Context是要显示Toast的 ...
- java-双大括号实例初始化的反模式
今天在看springboot的batch时, 看到这样一段代码, 直接把我看懵了, 于是找了一下, 发现这 两个大括号 {{ 叫实例初始化器 FlatFileItemReader<Person ...
- 从入门到不放弃系列之Koa2
一.Koa2入门 本来是想Express入门的,但是既然都是要学,干嘛不学最新的呢? 其实我想说,我本来只是想学个小程序开发,现在已经陆陆续续开了好多坑了.. 本文参考廖雪峰教程 二.Async 最新 ...
- 三种数据库访问——原生JDBC
原生的JDBC编程主要分一下几个步骤: (原生的JDBC编程指,仅应用java.sql包下的接口和数据库驱动类编程,而不借助任何框架) 1. 加载JDBC驱动程序: 2. 负责管理JDBC驱动程序的类 ...
- angularjs 依赖注入原理与实现
在用angular依赖注入时,感觉很好用,他的出现是 为了“削减计算机程序的耦合问题” ,我怀着敬畏与好奇的心情,轻轻的走进了angular源码,看看他到底是怎么实现的,我也想写个这么牛逼的功能.于是 ...
- ABP学习入门系列(四)(创建Service)
一,一些相关解释 Service 在应用服务层也就是application层.应用服务用于将领域(业务)逻辑暴露给展现层.展现层通过传入DTO(数据传输对象)参数来调用应用服务,而应用服务通过领域对象 ...
- win7下使用IIS服务器及自定义服务器端包含模块(SSI)步骤
配置完过段时间就容易忘记,特此记录. 1.开启IIS服务器. 默认没有安装,需要先安装. 打开控制面板–> 打开“程序和功能”–> 左侧选择“启用或关闭windows功能”–> 找到 ...
- 数据库状态标识位flag设计
设计目的 减少各种状态值字段 减少数据库冗余和存储空间 增加状态值时可灵活调整,无需增加额外字段 运用场景 例子1:管理用户的支付方式 比如针对不同用户组设置了不同的支付方式支持,假设支付方式有支付宝 ...
- [源码] 定义String s="abcd", 求长度
一般会答: s.length() 看源码是如何实现的: /** * Returns the length of this string. * The length is equal to the nu ...
- 第一节:Java初识与计算机基础
一.计算机 = 硬件 + 软件 1.硬件:计算机中看的见摸得着的物理元件,例如:CPU(中央处理器).内存条.硬盘... CPU:计算机的运算和控制核心,主要用于对数据的逻辑运算以及对计算机指令的解析 ...