两个页面之间的动画跳转。

接触到了两个页面之间的跳转带动画的。效果还不错。

一,先上项目总体图。

二,上代码。

AppDelegate.m文件

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.

    FirstViewController *firstView=[[FirstViewController alloc]init];
    UINavigationController *nav=[[UINavigationController alloc]initWithRootViewController:firstView];
    self.window.rootViewController=nav;

    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    return YES;
}

FirstViewController.m文件

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    self.title=@"FirstVC";
    self.view.backgroundColor=[UIColor redColor];
}
//点击页面任何处跳转到页面二
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    SecondViewController *secondVC=[[SecondViewController alloc]init];

    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:0.9];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:YES];
    [self.navigationController pushViewController:secondVC animated:NO];
    [UIView commitAnimations];

}

SecondViewController.m文件

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    self.title=@"SecondVC";
    self.view.backgroundColor=[UIColor blueColor];
}
时间: 2024-08-27 18:48:54

两个页面之间的动画跳转。的相关文章

Android两个页面之间的切换效果工具类

import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Build; import android.widget.Toast; public class ActivityAnimationUtil { private Context context; pr

HTML5中window.postMessage,在两个页面之间的数据传递

HTML5中window.postMessage,在两个页面之间的数据传递 2015年11月3日 8536次浏览 关于postMessage window.postMessage虽然说是html5的功能,但是支持IE8+,假如你的网站不需要支持IE6和IE7,那么可以使用window.postMessage.关于window.postMessage,很多朋友说他可以支持跨域,不错,window.postMessage是客户端和客户端直接的数据传递,既可以跨域传递,也可以同域传递. 应用场景 我只

两个页面之间的通信

今天要给大家说的是两个不同页面之间的通信,通过一个拖拽demo来模拟: 首先,写好基础的拖拽代码: <script> window.onload = function() { var oDiv = document.getElementById('div'); oDiv.onmousedown = function(ev) { var ev = window.event || ev; var disX = ev.clientX - oDiv.offsetLeft; var disY = ev.

如何实现两个页面之间进行传值

参考地址:http://blog.csdn.net/hlk_1135/article/details/52809468 B/S页面间通信 HTTP是无状态的协议.Web页面本身无法向下一个页面传递信息,如果需要让下一个页面得知该页面中的值,除非通过服务器.因此,Web页面保持状态并传递给其它页面,是一个重要的技术. Web页面之间传递数据,是Web程序的重要功能 在HTTP协议中一共有4种方法来完成这件事情: 1)URL传值:2)表单传值:3)Cookie方法:4)Session方法: 一.UR

iOS 两个页面之间的跳转

-------->-------->-------->-------->-------->-------->-------->   以上完成页面one跳到页面Two  ,之后从页面Two返回页面One -------->-------->-------->-------->

js实现两个页面之间跳转参数传递

html在设计时,规定跳转地址后加"?"表示从此开始为跟随页面地址跳转的参数. 有时候,我们希望获得相应的跳转前页面里的内容,这时候我们就可以考虑将内容以参数形式放到地址中传过来,这里我建议将参数以变量形式传递. 代码案例如下: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>direct1.ht

两个页面之间的数据传递方法

1:通过URL传参(a页面<a href="b.html?n=zhangsan&p=123456">点击跳转到b页面</a>) b页面中的js代码:  function parseURL(url){    var url = url.split("?")[1];//分割字符串并取     console.log(url);    var para = url.split(/&|=/);    console.log(para)

Android TabActivity与Activity之间的动画跳转(主要Tabhost中跳转出来的动画效果解决)

首先,要说的是ActivityA到ActivityB的切换这个相对简单,只要overridePendingTransition(In,out). 这里不就说了.但是这里要说名的ActivityA不能TABHost里面的一个.因为Tabhost里面有自己的Activity其实还没有跳出 Tabhost生命.这个可以Log,Tabhost生命周期试试就知道了.其实Tabhost里面嵌套的Activity都在生命周期都在Tabhost里面.这样的话,Tabhost里面的Activity跳转到其他(非T

两个页面之间传值需要注意的问题

今天认识到自己的一个错误, 如果从一个页面传值到另一个页面, 前边页面用request,后边页面也要用request得到 类似的,response.pageContext.session.application依次对应 一般传值我们用request请求,因为它比较简单,response比较麻烦