ZFDragableModalTransition

Usage

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
TaskDetailViewController *detailViewController = segue.destinationViewController;
detailViewController.task = sender; // create animator object with instance of modal view controller
// we need to keep it in property with strong reference so it will not get release
self.animator = [[ZFModalTransitionAnimator alloc] initWithModalViewController:detailViewController];
self.animator.dragable = YES;
self.animator.direction = ZFModalTransitonDirectionBottom;
[self.animator setContentScrollView:detailViewController.scrollview]; // set transition delegate of modal view controller to our object
detailViewController.transitioningDelegate = self.animator;
detailViewController.modalPresentationStyle = UIModalPresentationCustom;
}

ScrollView

If you have scrollview in the modal and you want to dismiss modal by drag it, you need to set scrollview to ZFModalTransitionAnimator instance.

如果你在modal中有scrollview,而且你想通过拖拽来让控制器消失,你需要将这个scrollview设置成ZFModalTransitionAnimator的实例变量.

[self.animator setContentScrollView:detailViewController.scrollview];

Direction

You can set that which direction will our modal present. (default is ZFModalTransitonDirectionBottom)

你可以设置这个动画从哪个方向上来呈现.(默认是从底部呈现)

self.animator.direction = ZFModalTransitonDirectionBottom;

P.S. Now you can set content scrollview only with ZFModalTransitonDirectionBottom

P.S. 现在,通过以上设置后,动画想过将会从底部开始呈现.

Requirements

  • iOS >= 7.0 (tested on ios8 beta)
  • ARC

Installation

ZFDragableModalTransition is available through CocoaPods. To install it, simply add the following line to your Podfile:

ZFDragableModalTransition可以通过CocoaPods来安装.你只需要写如下的一段话就可以安装了:

pod "ZFDragableModalTransition"

Author

Amornchai Kanokpullwad, amornchai.zoon@gmail.com

License

ZFDragableModalTransition is available under the MIT license. See the LICENSE file for more info.

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

  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. glog功能介绍

    1.   概述       Google glog是一个基于程序级记录日志信息的c++库,编程使用方式与c++的stream操作类似,例:        LOG(INFO) << &quo ...

  2. kmean算法C++实现

    kmean均值算法是一种最常见的聚类算法.算法实现简单,效果也比较好.kmean算法把n个对象划分成指定的k个簇,每个簇中所有对象的均值的平均值为该簇的聚点(中心). k均值算法有如下五个步骤: 随机 ...

  3. SQLAlchemy之SQL Expression

    SQLAlchemy是一个强大的Python SQL工具箱, 提供了包括ORM在内的各种支持. 首先使用pip安装; pip install SQLAlchemy SQL Expression Lan ...

  4. Django请求响应对象

    请求与响应对象 HttpRequest HttpRequest存储了客户请求的相关参数和一些查询方法. path 请求页面的全路径,不包括域名-例如, "/hello/". met ...

  5. jQuery操作<input type="radio">

    input type="radio">如下: <input type="radio" name="city" value=&qu ...

  6. WebForm控件多字段绑定

    一.这里的多字段绑定是什么意思? 多字段绑定控件其实就是把两个字段显示在一起作为一个字段现在控件上! 可能读者看了可能还是有点懵逼,说的还是比较抽象!的确,光从这上面的确是无法具体到某特定一种情况!那 ...

  7. AutoFac使用方法总结四:生命周期续

         控制反转(IoC/Inverse Of Control):   调用者不再创建被调用者的实例,由autofac框架实现(容器创建)所以称为控制反转.      依赖注入(DI/Depende ...

  8. Android开发之旅1:环境搭建及HelloWorld

    ——工欲善其事必先利其器 引言 本系列适合0基础的人员,因为我就是从0开始的,此系列记录我步入Android开发的一些经验分享,望与君共勉!作为Android队伍中的一个新人的我,如果有什么不对的地方 ...

  9. 【 js 片段 】如何组织表单的默认提交?【亲测有效】

    最近做的一个项目,我分到的部分有表单验证.点击了提交按钮,但我并不想让他跳转页面去提交.于是经过各种百度,各种 stackoverflow,各种抱大神腿之后,有了以下解决办法: 重点就是阻止 form ...

  10. Web 系统架构一般组成

    负载层技术       负载分配层,是单指利用软件实现的计算机系统上的狭义负载均衡.它是根据业务形态设计一种架构方式,将来自外部客户端的业务请求分担到每一个可用的业务节点上 . 1.用户终端不只包括类 ...