[翻译] 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吧,我会尽快回复你的:)

目录
相关文章
|
9月前
|
人工智能 编解码 自然语言处理
中文LLaMA模型和指令精调的Alpaca大模型:中文数据进行二次预训练,进一步提升了中文基础语义理解能力
中文LLaMA模型和指令精调的Alpaca大模型:中文数据进行二次预训练,进一步提升了中文基础语义理解能力
|
1月前
|
算法 安全 测试技术
移相全桥DC-DC变换器
本文介绍了基于PPEC-86CA3A移相全桥数字电源控制芯片的电源设计与开发过程。首先,文章讲解了如何搭建移相全桥变换器的外围电路,并展示了相关硬件平台的图片。接着,详细阐述了使用PPEC Workbench软件进行快速开发的步骤,包括新建工程、设置控制参数、启动参数、保护参数以及通讯端口的选择,并提供了下发参数和调试的操作指南。在功能验证部分,涉及了采样校正、保护功能(如输出过压保护)的验证以及开环和闭环调试。最后,提到了PPEC-86CA3A芯片和PPEC Workbench软件在电源研发中的重要角色,它们简化了电源设计和调试的流程,降低了开发难度。
25 2
|
1月前
|
算法 安全 测试技术
移相全桥DC-DC变换器快速设计与开发
本篇将基于PPEC-86CA3A移相全桥数字电源控制芯片以及PPEC Workbench开发软件带领大家进行实际移相全桥DC-DC变换器的设计与开发 。 一、移相全桥变换器设计与开发 1、外围电路设计与硬件平台搭建 1)外围电路设计 这里给出了PPEC-86CA3A移相全桥数字电源控制芯片的采样、PWM驱动以及硬件保护等外围电路设计图,大家可参考下图进行外围电路搭建与连接。 2)硬件平台搭建 大家可根据前文介绍的参数设计方法进行电源拓扑的器件选型,再按照外围电路设计图搭建PWM驱动电路、采样电路以及保护电路并与电源控制核心进行连接。移相全桥DC-DC变换器的硬件测试平台如图。 2
48 2
|
10月前
参考文献将“et al.”替换为“等”的方法
本文介绍基于EndNote等软件在Word中插入参考文献后,将中文参考文献中的et al.替换为等的方法~
162 1
参考文献将“et al.”替换为“等”的方法
|
芯片
ADC模数转换器(内含:1.实物图+2.ADC简介+3.ADC框图+4.ADC基本结构图+5.输入通道+6.转换模式+7.触发控制+8.数据对齐+9.硬件电路)
ADC模数转换器(内含:1.实物图+2.ADC简介+3.ADC框图+4.ADC基本结构图+5.输入通道+6.转换模式+7.触发控制+8.数据对齐+9.硬件电路)
288 0
ADC模数转换器(内含:1.实物图+2.ADC简介+3.ADC框图+4.ADC基本结构图+5.输入通道+6.转换模式+7.触发控制+8.数据对齐+9.硬件电路)
|
Windows
Adobe - Reader & Acrobat Pro DC 无文字内容
Adobe - Reader & Acrobat Pro DC 无文字内容
213 0
Adobe - Reader & Acrobat Pro DC 无文字内容
SAP的BC425关于BTE部分的PA教材翻译
最直接的方法还是有个工程师面对面给你讲,但是如果没有个大活人给你讲解,我的建议是,看看PA教材吧,毕竟官方的东西。BTE的学名是Business Transaction Events,我靠事件啊BTE是什么身份什么地位呢?如下图上面只是个描述,我们看看重点,也就是说,SAP的增强其实有很多种方式,在BTE之前有老的方式,在BTE之后,还有更新的方式。
1492 0
|
Web App开发 前端开发 调度
How cc Works 中文译文
Chromium 的工程师们写了两篇技术文章 [How Blink Works][1] ([中文译文][2]) 和 [How cc Works][3],分别介绍了 Chrome 浏览器内核内部的两个重要模块 Blink 和 cc 内部设计和实现的一些细节。对于想要了解 Chromium 内核内部实现的同学,这两篇文章提供了不错的入门指引。在征得作者同意后,我将其翻译成中文,以馈读者。 文中部
1571 0

热门文章

最新文章