• segue场景跳转的使用总结


    a>iOS8之前的storyboard segue:

    在storyboard中,segue有几种不同的类型,在iphone和ipad的开发中,segue的类型是不同的。

    在iphone中,segue有:push,modal,和custom三种不同的类型,这些类型的区别在与新页面出现的方式。

    而在ipad中,有push,modal,popover,replace和custom五种不同的类型。

     

    modal: 

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

    是在viewController中的标准切换的方式,包括淡出什么的,可以选切换动画。

    Modalview:就是会弹出一个view,你只能在该view上操作,而不能切换到其他view,除非你关闭了modalview.

    Modal View对应的segue type就是modal segue

    *Modal:Transition to another scene for the purposes of completing a task.user在弹出的modalview里操作完后,就应该dismiss the modal view scene然后切换回the originalview.

     

    push:

    Push类型一般是需要头一个界面是个Navigation Controller的。

    是在navigation View Controller中下一级时使用的那种从右侧划入的方式

    *Push:Create a chain of scenes where the user can move forward or back.segue type是和navigation viewcontrollers一起使用。

     

    popover(iPad only)

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

    *Popover(iPad only):Displays the scene in a pop-up “window” over top of the current view.

     

    replace (iPad only):

    替换当前scene

    Replace the current scene with another. This is used in some specialized iPad viewcontrollers (e.g. split-view controller).

     

    custom

    就是自定义跳转方式啦。

    *Custom:Used for programming a customtransition between scenes.

    Storyboard中使用自定义的segue类型

     

    b>iOS8之后的storyboard segue:

    1Action Segue:

    show: 在master或detail区域展现内容(典型的如iPad的设置界面,左侧是master,右侧是detail),究竟是在哪个区要取决于屏幕上的内容,如果不分master/detail,就单纯的把新的内容push到当前view controller stack的顶部

    例如:如果app当前同时显示master和detail视图,内容将会压入detail区域。

        如果app当前仅显示master或者detail视图,内容则压入当前视图控制器堆栈中的顶层视图。

    show detail: 在master或detail区域展现内容(典型的如iPad的设置界面,左侧是master,右侧是detail),究竟是在哪个区要取决于屏幕上的内容,如果不分master/detail,就单纯的把新的内容push到当前view controller stack的顶部

    例如:即使app同时显示master和detail视图,那么内容将被压入detail区域

        如果app当前仅显示Master或者detail视图,那么内容将替换当前视图控制器堆栈中的顶层视图。

    present modally:模态展示内容

     使用模态展示内容。属性面板中提供presentation style (UIModalPresentationStyle)与 transition style (UIModalTransitionStyle)两种选项

    popover presentation:在当前的view上出现一个小窗口来展示内容,无处不在的“选中文字后出现 复制/翻译 按钮

    在某个现有视图中的锚点处使用弹出框展示内容。这个选项可指定显示在弹出框视图一边上的箭头可用方向,同时也是指定锚点视图的一个选项。

    custom:自定义

     

    2、Non-adaptive Action Segue:

    push (deprecated):取消的

    modal (deprecated):取消的

     

  • 相关阅读:
    cookie和session的区别和用法
    JavaScript深浅拷贝
    前端知识
    typescript -- ts
    vue笔记精华部分
    宜人贷项目里-----正则匹配input输入月份规则
    PHP-Socket-阻塞与非阻塞,同步与异步概念的理解
    PHP socket客户端长连接
    PHP exec/system启动windows应用程序,执行.bat批处理,执行cmd命令
    查看局域网内所有ip
  • 原文地址:https://www.cnblogs.com/yuhao309/p/6653415.html
Copyright © 2020-2023  润新知