zl程序教程

您现在的位置是:首页 >  其它

当前栏目

[翻译] DCPathButton

翻译
2023-09-14 08:57:17 时间

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 buttons 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来下载

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


SAP的BC425关于BTE部分的PA教材翻译 最直接的方法还是有个工程师面对面给你讲,但是如果没有个大活人给你讲解,我的建议是,看看PA教材吧,毕竟官方的东西。BTE的学名是Business Transaction Events,我靠事件啊BTE是什么身份什么地位呢?如下图上面只是个描述,我们看看重点,也就是说,SAP的增强其实有很多种方式,在BTE之前有老的方式,在BTE之后,还有更新的方式。
How cc Works 中文译文 Chromium 的工程师们写了两篇技术文章 [How Blink Works][1] ([中文译文][2]) 和 [How cc Works][3],分别介绍了 Chrome 浏览器内核内部的两个重要模块 Blink 和 cc 内部设计和实现的一些细节。对于想要了解 Chromium 内核内部实现的同学,这两篇文章提供了不错的入门指引。在征得作者同意后,我将其翻译成中文,以馈读者。