码迷,mamicode.com
首页 > 移动开发 > 详细

ios 页面滑入滑出

时间:2014-08-07 18:25:20      阅读:228      评论:0      收藏:0      [点我收藏+]

标签:os   io   strong   for   size   window   ios   app   

从左边滑进

CGRect r1,r2;

            r1 = app.testview.view.frame;

            r2 = self.view.frame;

            [app.testview.view setFrame:CGRectMake(320, r1.origin.y,r1.size.width,r1.size.height)];

            [UIView beginAnimations:nil context:nil];

            [UIView setAnimationDuration:0.4];

            [app.window addSubview:[app.testview view]];

            [app addConvertview];//添加遮挡层

            

            [self.view setFrame:CGRectMake(-320, r2.origin.y,r2.size.width,r2.size.height)];

            [app.testview.view setFrame:CGRectMake(0, r1.origin.y,r1.size.width,r1.size.height)];

            [UIView commitAnimations];

            [self performSelector:@selector(removeSelf) withObject:nil afterDelay:0.6];

右边滑出

  CGRect r1,r2;

    r1 = app.TestView.view.frame;

    r2 = self.view.frame;

    [app.TestView.view setFrame:CGRectMake(-320, r1.origin.y,r1.size.width,r1.size.height)];

    [UIView beginAnimations:nil context:nil];

    [UIView setAnimationDuration:0.4];

[app.window addSubview:[app.TestView view]];

    [app addConvertview];//添加遮挡层

    

    [self.view setFrame:CGRectMake(320, r2.origin.y,r2.size.width,r2.size.height)];

    [app.TestView.view setFrame:CGRectMake(0, r1.origin.y,r1.size.width,r1.size.height)];

    

    [UIView commitAnimations];

    [self performSelector:@selector(removeSelf) withObject:nil afterDelay:0.6];

ios 页面滑入滑出,布布扣,bubuko.com

ios 页面滑入滑出

标签:os   io   strong   for   size   window   ios   app   

原文地址:http://www.cnblogs.com/XCoderLiu/p/3897561.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!