[翻译] DCPathButton
DCPathButton

https://github.com/Tangdixi/DCPathButton


DCPathButton 2.0 is a menu button for iOS. Designed by a famous iOS App Path.
Since Path 4.0, this beautiful button was moved into the tab bar, with a new design.
So the DCPathButton is totally a copy, including the animations, the sounds and the button's images ( of cource you can use your own images ).
DCPathButton2.0是一个iOS菜单按钮.是Path应用中一个很精彩的设计.
自从Path4.0之后,这个按钮就被移动到了tab bar上去了,变成另外一种新的设计了.
所以,DCPathButton完全复制了它的功能,包括动画,声音以及按钮图标(当然,你也可以替换成你自己的图标)
How To Get Started - 如何开始
- Download DCPathButton 直接下载DCPathButton
- Clone DCPathButton 通过git来下载
git clone git@github.com:Tangdixi/DCPathButton.git
Installation - 安装
Of cource, you can install DCPathButton in a traditional way -- drag the DCPathButton folder into your projects. but I strongly recommanded that you install from CocoaPods
当然,你也可以直接用传统的方式来安装DCPathButton = 将DCPathButton文件夹拖到你的项目当中去.但是我强烈建议你通过CocoaPods来安装.
Requirement
- AudioToolBox.framework
- QuartzCore.framework
Install with CocoaPods - 通过CocoaPods安装
CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like DCPathButton in your projects.
Podfile
platform :ios, '7.0'
pod 'DCPathButton', '~> 2.0'
Usage - 使用
Create a DCPathButton - 创建DCPathButton
1.import the "DCPathButton" to your controller 将DCPathButton头文件引入到你的控制器中
import "DCPathButton.h"
2.Add the DCPathButtonDelegate to your controller 添加代理
@interface ViewController ()<DCPathButtonDelegate>
3.Create a center button and add it into your view 创建一个中间的按钮并添加到你的view上
DCPatButton *centerButton = [[DCPathButton alloc]initWithCenterImage:[UIImage imageNamed:@"chooser-button-tab"]
hilightedImage:[UIImage imageNamed:@"chooser-button-tab-highlighted"]];
[self.view addSubView:centerButton];
4.Create some item buttons and add them into the center button 创建其他的item按钮并将它附加在刚刚在中间创建的按钮上
DCPathItemButton *itemButton_1 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"image"]
highlightedImage:[UIImage imageNamed:@"highlightedImage"]
backgroundImage:[UIImage imageNamed:@"backgroundImage"]
backgroundHighlightedImage:[UIImage imageNamed:@"backgroundhighlightedImage"]]; [centerButton addPathItems:@[itemButton_1]];
DCPathButtonDelegate - 代理方法
DCPathButtonDelegate handle the action when you fire the item buttons which is similar to theUITableViewDelegate, control the items through the index
You can add one item at least or five items at most. Assume we have five items, so the index is 0 to 4 :)
当你点击按钮的时候,DCPathButtonDelegate控制着所有的按钮事件,你可以通过index值来识别按钮,最少一个按钮以及最多5个按钮.
- (void)itemButtonTappedAtIndex:(NSUInteger)index
{
if(index == 0){
// When the user tap index 1 here ...
}
else{
// other code here ...
}
}
Custom Property - 自定义属性
@property (assign, nonatomic) CGFloat bloomRadius;
bloomRadius is use to handle the item button bloom radius, default is 105.0f;
bloomRadius是用来控制展开i899iseftet效果的角度的,默认值为105.f;
Now there is only one public property in DCPathButton. :|
If you want more DIY. Just open an issue, tell me what you want. :)
现在在DCPathButton里面只有一个公开的属性:|,如果你想要更多的定制的效果,你就提一个issue,告诉我你想要添加的:)
Problems, bugs or advice - 问题,bug以及建议
Open an issue guys :)
I will reply you as quickly as I can.
提issue吧,我会尽快回复你的:)
[翻译] DCPathButton的更多相关文章
- 《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 ...
随机推荐
- git工具,conflict冲突解决方法
这篇文章需要对git具有一定的了解,并且知道如何安装git工具(其实就是上git官网下载个文件,安装) git这种版本控制工具有什么好处 第一个,方便可以多人协同开发同一个项目或系统 第二个,当你系统 ...
- 使用fastjson进行转换
package junit.test; import java.util.ArrayList; import java.util.HashMap; import java.util.List; imp ...
- 分布式ID生成方法-趋势有序的全局唯一ID
一.需求缘起 几乎所有的业务系统,都有生成一个记录标识的需求,例如: (1)消息标识:message-id (2)订单标识:order-id (3)帖子标识:tiezi-id 这个记录标识往往就是数据 ...
- GreenPlum:基于PostgreSQL的分布式关系型数据库
GreenPlum是一个底层是多台PostgreSQL分表分库的分布式数据库,它有如下特点 支持标准SQL,几乎所有PostgreSQL支持的SQL,greenplum都支持 支持ACID.分布式事务 ...
- 破局人工智能:构建AI,与腾讯云一起探索语音应用场景
本文来自腾讯云技术沙龙,本次沙龙主题为AI平台及智能语音应用解析 近年来,人工智能技术快速发展,与其他行业的结合也成为业界不断探索的方向.在人工智能基础和工具方面,AI平台已成为降低人工智能门槛的关键 ...
- Web--CSS控制页面(link与import方式区别)
先了解: [1] “Table”和“DIV”这两个网页元素诞生的目的不同,首先Table诞生的目的是为了存储数据,而DIV诞生的目的就是为了架设页面结构 W3C,是World Wide ...
- oracle 一对多数据分页查询筛选
今天项目测试运行的时候,遇到了一个奇怪的问题,这个问题说起来按sql语法的话是没有错误的 但是呢按照我们的业务来做区分就有些逻辑上的错误了, 下面请听我慢慢道来,在数据库中有两个数据, 先来看下第一次 ...
- Docker 私有registry出现的证书问题
在上一篇 最近搭建的私有registry里,参考的文章指出,在push时可能出现问题: 可能会出现无法push镜像到私有仓库的问题.这是因为我们启动的registry服务不是安全可信赖的.这是我们需要 ...
- C#中深拷贝和浅拷贝
一:概念 内存:用来存储程序信息的介质. 指针:指向一块内存区域,通过它可以访问该内存区域中储存的程序信息.(C#也是有指针的) 值类型:struct(整形.浮点型.decimal的内部实现都是str ...
- Jetty源码解析(web.xml的处理机制)
org.eclipse.jetty.webapp 包下的 StandardDescriptorProcessor类.该类对象会在WebAppContext的doStart方法启用 注册了遍历web.x ...