MagicPie

Powerful pie layer for creating your own pie view. PieLayer provide great animation with simple usage.

PieLayer是一个非常强大的layer,非常易用,效果很炫。

The main advantage of that control that there is no worry about displaying of animation. Animation will display correctly even if you will add new elements during execution of another slice deleting animation. That's amazing! And here is no delegates. I like delegates, but in this case I think they are excess.

这个动画的主要特点是,你不需要担心在添加控件的同时影响删除的动画,而且也没有烦人的代理。我很喜欢代理,但是,我觉得,在这里使用的话就太没有节操了。

Be creative =)

Installation - 安装

Edit your PodFile to include the following line:

编辑你的PodFile,添加以下一行:

pod 'MagicPie'

Then import the main header.

然后,导入头文件:

#import <MagicPieLayer.h>

Have a fun!

^_^!

Example Usage - 使用示例

Create pie: 创建pie

PieLayer* pieLayer = [[PieLayer alloc] init];
pieLayer.frame = CGRectMake(0, 0, 200, 200);
[self.view.layer addSublayer:pieLayer];

Add slices: 添加切片

[pieLayer addValues:@[[PieElement pieElementWithValue:5.0 color:[UIColor redColor]],
[PieElement pieElementWithValue:4.0 color:[UIColor blueColor]],
[PieElement pieElementWithValue:7.0 color:[UIColor greenColor]]] animated:YES];

Change value with animation: 修改值来执行动画

PieElement* pieElem = pieLayer.values[0];
[PieElement animateChanges:^{
pieElem.val = 13.0;
pieElem.color = [UIColor yellowColor];
}];

Delete slices: 删除切片

[pieLayer deleteValues:@[pieLayer.values[0], pieLayer.values[1]] animated:YES];

[翻译] MagicPie的更多相关文章

  1. 《Django By Example》第五章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者@ucag注:大家好,我是新来的翻译, ...

  2. 《Django By Example》第四章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:祝大家新年快乐,这次带来<D ...

  3. [翻译]开发文档:android Bitmap的高效使用

    内容概述 本文内容来自开发文档"Traning > Displaying Bitmaps Efficiently",包括大尺寸Bitmap的高效加载,图片的异步加载和数据缓存 ...

  4. 【探索】机器指令翻译成 JavaScript

    前言 前些时候研究脚本混淆时,打算先学一些「程序流程」相关的概念.为了不因太枯燥而放弃,决定想一个有趣的案例,可以边探索边学. 于是想了一个话题:尝试将机器指令 1:1 翻译 成 JavaScript ...

  5. 《Django By Example》第三章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:第三章滚烫出炉,大家请不要吐槽文中 ...

  6. 《Django By Example》第二章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:翻译完第一章后,发现翻译第二章的速 ...

  7. 《Django By Example》第一章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:本人目前在杭州某家互联网公司工作, ...

  8. 【翻译】Awesome R资源大全中文版来了,全球最火的R工具包一网打尽,超过300+工具,还在等什么?

    0.前言 虽然很早就知道R被微软收购,也很早知道R在统计分析处理方面很强大,开始一直没有行动过...直到 直到12月初在微软技术大会,看到我软的工程师演示R的使用,我就震惊了,然后最近在网上到处了解和 ...

  9. ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第一章:创建基本的MVC Web站点

    在这一章中,我们将学习如何使用基架快速搭建和运行一个简单的Microsoft ASP.NET MVC Web站点.在我们马上投入学习和编码之前,我们首先了解一些有关ASP.NET MVC和Entity ...

随机推荐

  1. 第1章—Spring之旅—容纳你的Bean

    容纳你的Bean 在基于Spring的应用中,你的应用对象生存于Spring容器中.Spring负责创建对象,装配他们,配置他们并管理他们整个生命周期,从生存到死亡(在这里 可能是new 到 fina ...

  2. vue下拉搜索

    vue版本是1.0.21 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> ...

  3. JavaScript数据结构-6.优先队列

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  4. JavaScript数据结构-3.List

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  5. linux mint 19 pyenv 安装 python 3.7.0 问题解决

    Python3: ImportError: No module named '_ctypes' 解决 sudo apt-get install libffi-dev WARNING: The Pyth ...

  6. js关闭当前页面

    <a href="javascript:window.opener=null;window.open('','_self');window.close();">关闭&l ...

  7. C/C++中字符串与数字转换

    本文总结了四种字符串和数字相互转换的方法,方法一和方法二是c++中的方法,方法三和方法四是C语言库函数的方法. 方法一:c++11中string中添加了下面这些方法帮助完成字符串和数字的相互转换 st ...

  8. kd树 C++实现

    参考:百科kd-tree /* * kdtree.h * * Created on: Mar 3, 2017 * Author: wxquare */ #ifndef KDTREE_H_ #defin ...

  9. 使用JS传递数组型数据回服务器

    //为数组添加一个方法,判断某个值是否存在于数组中 Array.prototype.in_array = function (e) { for (i = 0; i < this.length & ...

  10. C# 随机数类

    using System; namespace DotNet.Utilities { /// <summary> /// BaseRandom /// 产生随机数 /// /// 随机数管 ...