• ios 页面滑入滑出


    从左边滑进

    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];

  • 相关阅读:
    dpkg 删除 百度网盘 程序
    ubuntu 安装go
    解决 swap file “*.swp”already exists!问题
    ROS Topic 常用指令
    正交概念
    vim 永久显示行号 & 临时显示行号
    awk、grep、sed
    Keil中使用Astyel进行C语言的格式化
    红黑树学习
    802.11 对于multicast 和 broadcast的处理
  • 原文地址:https://www.cnblogs.com/XCoderLiu/p/3897561.html
Copyright © 2020-2023  润新知