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

  • 相关阅读:
    一段asp程序中效率极低的代码,造成连接数据库超时
    古月照今尘
    with C# Code run on Dynamicx AX 2009
    Using X++ Code export to methods list of Class
    Useing X++ code saved as full Screen Resolution Image
    Find out field list(EDT) on a AX Table
    进制转换
    with tableId and fieldname get to the field value on a Common table records
    Set focus on the dialog field
    Label in Dynamics AX 2009
  • 原文地址:https://www.cnblogs.com/yuyu-2012/p/5051178.html
Copyright © 2011-2022 走看看