zoukankan      html  css  js  c++  java
  • 跨Storyboard调用

    在开发中我们会有这种需求从一个故事板跳到另一个故事板

    modal

    1     UIStoryboard *secondStoryboard = [UIStoryboard storyboardWithName:@"Storyboard1" bundle:nil];//获取故事板
    2     UIViewController *firstVC = [secondStoryboard instantiateViewControllerWithIdentifier:@"firstVC "];//获取故事板中的页面
    3    [self presentViewController:firstVC animated:YES completion: nil];

    push

    1 UIStoryboard *secondStoryboard = [UIStoryboard storyboardWithName:@"Storyboard1" bundle:nil];
    2 UIViewController *firstVC = [secondStoryboard instantiateViewControllerWithIdentifier:@"firstVC "];
    3 [self.navigationController pushViewController:firstVC animated:NO];

    注:获取故事板中的页面有两种方法

    - (id)instantiateInitialViewController;//默认加载故事板中入口的页面

    - (id)instantiateViewControllerWithIdentifier:(NSString *)identifier;//按照指定ID找页面,可以加载故事板中任意的页面

  • 相关阅读:
    原生js系列 删除元素
    事件绑定的几种方式
    js的五种输出方式
    三、浏览器事件处理机制--事件循环(event loop)
    二、事件流、事件代理
    一、事件的分类
    js数据类型转换
    html锚点
    观察者模式
    策略模式
  • 原文地址:https://www.cnblogs.com/zhangjingyangjinjin/p/4624887.html
Copyright © 2011-2022 走看看