[翻译] DoActionSheet
DoActionSheet

https://github.com/donobono/DoActionSheet
An replacement for UIActionSheet : block-based, customizable theme, easy to use with image or map
用于替换UIActionSheet:基于block使用,自定义主题,方便展示图片或者地图
Preview
with title, with destructive button, with cancel button and with image 有标题,有描述按钮,以及取消按钮,展示用图片

support scroll if there are many buttons but cancel button’s position is fixed 支持滚动,支持多按钮,只有取消按钮的位置是固定不动的

with map 支持地图

Requirements
- iOS 7.0 and greater 支持iOS7及以上
- ARC ARC
Examples
Code:
DoActionSheet *vActionSheet = [[DoActionSheet alloc] init];
// required
vActionSheet.nAnimationType = _sgType.selectedSegmentIndex; // there are 3 type of animation // optional
vActionSheet.dButtonRound = 2; // with image
vActionSheet.iImage = [UIImage imageNamed:@"pic1.jpg"];
vActionSheet.nContentMode = DoContentImage; // with map
vActionSheet.nContentMode = DoContentMap;
vActionSheet.dLocation = @{@"latitude" : @(37.78275123), @"longitude" : @(-122.40416442), @"altitude" : @200}; // launch DoActionSheet! - With destructive button, cancel button and title
vActionSheet.nDestructiveIndex = 2; [vActionSheet showC:@"What do you want for this photo?"
cancel:@"Cancel"
buttons:@[@"Post to facebook", @"Post to Instagram", @"Delete this photo"]
result:^(int nResult) { NSLog(@"---------------> result : %d", nResult); }]; // launch DoActionSheet! - With title and without cancel button
[vActionSheet show:@"What do you want?"
buttons:@[@"Open with Safari", @"Copy the link"]
result:^(int nResult) { NSLog(@"---------------> result : %d", nResult); }];
// customizable theme
#define DO_BACK_COLOR DO_RGB(232, 229, 222) // button background color
#define DO_BUTTON_COLOR DO_RGB(158, 132, 103)
#define DO_CANCEL_COLOR DO_RGB(240, 185, 103)
#define DO_DESTRUCTIVE_COLOR DO_RGB(124, 192, 134) // button text color
#define DO_TITLE_TEXT_COLOR DO_RGB(95, 74, 50)
#define DO_BUTTON_TEXT_COLOR DO_RGB(255, 255, 255)
#define DO_CANCEL_TEXT_COLOR DO_RGB(255, 255, 255)
#define DO_DESTRUCTIVE_TEXT_COLOR DO_RGB(255, 255, 255)
又一个学习 UIActionSheet 的绝好素材 :)
[翻译] DoActionSheet的更多相关文章
- 《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 ...
随机推荐
- Redis快照持久化
Redis的持久化功能: redis为了内部数据的安全考虑,会把本身的数据以文件的形式保存到硬盘中一份,在服务器重启之后会自动把硬盘的数据恢复到内存(redis)里边. 数据保存到硬盘的过程就被称为” ...
- 在Ubuntu16.04集群上手工部署Kubernetes
目前Kubernetes为Ubuntu提供的kube-up脚本,不支持15.10以及16.04这两个使用systemd作为init系统的版本. 这里详细介绍一下如何以非Docker方式在Ubuntu1 ...
- JavaScript设计模式-11.桥梁模式
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- "Visual Studio Code is unable to watch for file changes in this large workspace"
https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-chang ...
- PHP之mb_strripos使用
mb_strripos (PHP 4 >= 4.0.6, PHP 5, PHP 7) mb_strrpos - Find position of last occurrence of a str ...
- C#(winform)设置窗体的启动位置
只需要设置窗体的StartPosition属性: registerForm.StartPosition = FormStartPosition.CenterScreen; FormStartPosit ...
- Integer源码分析
Integer中包含了大量的static方法. 1.分析Integer的缓存机制:首先定义了一个缓存区,IntegerCache,其实就是一个Integer数组cache[],它默认存储了从-128~ ...
- 迁移SharePoint搜索服务至新的服务器
转自:http://blog.fpweb.net/move-sharepoint-2013-search-components-to-new-server/#.V_w4JZH_6uh In this ...
- i.mx6 Android5.1.1 servicemanager本地服务
接在之前的 i.mx6 Android5.1.1 初始化流程之init进程 i.mx6 Android5.1.1 初始化流程之init.rc解析 servicemanager是由init创建的本地服务 ...
- 一、window下zookeeper独立部署
zookeeper是一个分布式协调应用,用于管理大型主机.通俗地说,分布式应用相对于单体应用存在着很多要处理的问题,而这些问题通常是不太好处理的.比如,典型的一致性问题,而zookeeper可以很简单 ...