push自定义动画
//// ViewController.m// ViewControllerAnimation//// Created by mac on 15/5/26.// Copyright (c) 2015年 BSY. All rights reserved.//#import "ViewController.h"#import "TwoViewController.h"@interface ViewController ()<UINavigationControllerDelegate,UIViewControllerTransitioningDelegate>@property(nonatomic,strong)TwoViewController*two;@property(nonatomic,strong)UIViewController *currentViewController;;@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; self.title = @"第一页"; self.view.backgroundColor = [UIColor grayColor]; self.Animator = [[BSYAnimator alloc]init]; self.TransitionAnimator = [[BSYTransitionAnimator alloc]init]; UIButton *button = [UIButton buttonWithType: UIButtonTypeCustom]; [button setFrame:CGRectMake(100, 100, 100, 100)]; [button setTitle:@"Push" forState:UIControlStateNormal]; [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [self.view addSubview:button]; [button addTarget:self action:@selector(buttonClick) forControlEvents:UIControlEventTouchUpInside]; TwoViewController *two = [[TwoViewController alloc]init]; self.two = two; self.navigationController.delegate = self; two.transitioningDelegate = self; two.modalPresentationStyle = UIModalPresentationCustom; [self addChildViewController:two]; self.currentViewController = two;}-(void)buttonClick{ [self.navigationController pushViewController:self.two animated:YES];}#pragma mark - UINavigationControllerDelegate iOS7新增的2个方法// 动画特效- (id<UIViewControllerAnimatedTransitioning>) navigationController:(UINavigationController *)navigationController animationControllerForOperation:(UINavigationControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC{ if (operation == UINavigationControllerOperationPush) { return self.Animator; }else{ return nil; }}#pragma mark - Transitioning Delegate (Modal)-(id<UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source{ self.TransitionAnimator.animationType = AnimationTypePresent; return self.TransitionAnimator;}-(id<UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed{ self.TransitionAnimator.animationType = AnimationTypeDismiss; return self.TransitionAnimator;}@endpush自定义动画的更多相关文章
- iOS 8自定义动画转场上手指南
原文:http://www.cocoachina.com/ios/20150126/11011.html iOS 5发布的时候,苹果针对应用程序界面的设计,提出了一种全新的,革命性的方法—Storyb ...
- android 自定义动画
android自定义动画注意是继承Animation,重写里面的initialize和applyTransformation,在initialize方法做一些初始化的工作,在applyTransfor ...
- Android开发学习之路-RecyclerView的Item自定义动画及DefaultItemAnimator源码分析
这是关于RecyclerView的第二篇,说的是如何自定义Item动画,但是请注意,本文不包含动画的具体实现方法,只是告诉大家如何去自定义动画,如何去参考源代码. 我们知道,RecyclerView默 ...
- 深入学习jQuery自定义动画
× 目录 [1]属性对象 [2]可选参数 [3]选项参数 前面的话 很多情况下,前面介绍的jQuery动画的简单效果无法满足用户的各种需求,那么就需要对动画有更多的限制,需要采取一些高级的自定义动画来 ...
- 自定义动画css属性
自定义动画: 1.animation-name(自定义动画名称) 元素所应用的动画名称,必须与@keyframes使用,名称由@keyframes定义. keyframes(动画关键帧):以@keyf ...
- [UE4]CustomAnimationBlueprintNode 自定义动画蓝图节点
目的:在AnimationBlueprint中使用自定义动画控制节点. 主要过程: 1. 引用相关模块.在Client.Build.cs文件中,PublicDependencyModuleN ...
- CSS3初学篇章_6(自定义动画)
自定义动画 由于有一部分低版本的浏览器并不支持的问题,所以这个样式要多做兼容,各大浏览器兼容前缀如下: 前缀 浏览器 -webkit chrome和safari -moz firefox - ...
- Popwindow自定义动画(nexus5不支持暂未解决)
遇到一个问题,先记录一下 PopWindow自定义动画 import android.app.Activity; import android.graphics.drawable.BitmapDraw ...
- Android开发UI之自定义动画
自定义动画,需要新建一个类,继承Animation类. 重写applyTransformation()方法和initialize()方法. applyTransformation(float inte ...
随机推荐
- Oracle导出导入dmp文件(exp.imp命令行)
1.说明 使用Oracle命令行导出导入dmp文件, 从而在两个数据库之间快速转移数据, 也可以用来作为数据库的备份, 将来可以快速恢复数据. 命令:导出exp.导入imp 步骤: 使用Oracle的 ...
- mybatis学习笔记(三)
使用mapper接口来实现数据操作 创建UserMapper接口,添加方法,方法名要与UserMappper.xml中id所一致并且接口名要与编写sql语句的xmL文件名同名.namespace 中的 ...
- JUC并发编程与高性能内存队列disruptor实战-上
JUC并发实战 Synchonized与Lock 区别 Synchronized是Java的关键字,由JVM层面实现的,Lock是一个接口,有实现类,由JDK实现. Synchronized无法获取锁 ...
- 解惑rJava R与Java的高速通道
解惑rJava R与Java的高速通道 R的极客理想系列文章,涵盖了R的思想,使用,工具,创新等的一系列要点,以我个人的学习和体验去诠释R的强大. R语言作为统计学一门语言,一直在小众领域闪耀着光芒. ...
- RichTextBox单独设置文字颜色
richTextBox1.Select(index, "str1".Length); richTextBox1.SelectionColor = Color.Red;
- 豆瓣爬虫——通过json接口获取数据
最近在复习resqusts 爬虫模块,就重新写了一个豆瓣爬虫,这个网页从HTML 源码上来看是没有任何我想要的信息的,如下图所示: 这是网页视图,我在源码中查找影片信息,没有任何信息,如图: 由此我判 ...
- netty基础知识
参考 http://www.infoq.com/cn/articles/netty-high-performance 1. 传统 RPC 调用性能差的三宗罪 1)网络传输方式问题 2)序列化方式问题 ...
- 建造者模式(Bulider模式)
模式的定义与特点 建造者(Builder)模式的定义:指将一个复杂对象的构造与它的表示分离,使同样的构建过程可以创建不同的表示,这样的设计模式被称为建造者模式.它是将一个复杂的对象分解为多个简单的对象 ...
- gin的源码解读4-gin的路由算法
gin的路由算法 gin的是路由算法其实就是一个Trie树(也就是前缀树). 有关数据结构的可以自己去网上找相关资料查看. 注册路由预处理 我们在使用gin时通过下面的代码注册路由 普通注册 rout ...
- gin框架简介
介绍 Gin是一个golang的微框架,封装比较优雅,API友好,源码注释比较明确,具有快速灵活,容错方便等特点 对于golang而言,web框架的依赖要远比Python,Java之类的要小.自身的n ...