zoukankan      html  css  js  c++  java
  • IOS StoryBoard下的视图跳转

    segue共有三种类型:push,modal,和custom

    使用导航栏压进新的控制器(push),模态的加载视图控制器(modal),自定义(custom)

    第一种就是以上我的例子,利用button组件,拖拽添加segue,直接运行就可以用。

    第二种是利用ViewController与ViewController之间,拖拽添加segue。不过,这种方法就需要在相应需要跳转的方法内写入代码,手动去设置它的跳转。

    [self performSegueWithIdentifier:@"xxxx" sender:self];

     //根据 segue Identifier跳转界面

        [self performSegueWithIdentifier:@"GotoTwo" sender:self];

        

     1.  //以modal 方式跳转

        最常用的场景,新的场景完全盖住了旧的那个。用户无法再与上一个场景交互,除非他们先关闭这个场景

        [self presentModalViewController:nil animated:YES];

        odalview:就是会弹出一个view,你只能在该view上操作,而不能切换到其他view,除非你关闭了modalview.
        Modal View对应的segue type就是modal segue。

     2.  //push 压进一个viewcontroller

          Push类型一般是需要头一个界面是个Navigation Controller的。
          是在navigation View Controller中下一级时使用的那种从右侧划入的方式
          *Push:Create a chain of scenes where the user can move forward or back.该segue type是和navigation viewcontrollers一起使用。

          [self.navigationController pushViewController:nil animated:YES];

     3.  //popover弹出一个viewcontroller  相当与返回上一个界面

          popover 类型,就是采用浮动窗的形式把新页面展示出来

        [self.navigationController popViewControllerAnimated:YES];

        

     4.  // 以 modal跳转的返回方法

        [self dismissModalViewControllerAnimated:YES];

    参考:http://blog.csdn.net/xuqiang918/article/details/17023737

  • 相关阅读:
    com.mongodb.MongoException$CursorNotFound: cursor not found on server异常处理
    Oracle中暂时表空间的清理
    java——数组
    二分查找的感悟
    【转】Linux时间函数之gettimeofday()函数之使用方法
    【转】《APUE》第三章笔记(4)及习题3-2
    【转】APUE习题4.6---测试lseek作用
    【转】linux下a.out >outfile 2>&1重定向问题
    【转】./a.out 2>&1 > outfile
    【转】apue《UNIX环境高级编程第三版》第一章答案详解
  • 原文地址:https://www.cnblogs.com/yuyu-2012/p/5051178.html
Copyright © 2011-2022 走看看