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找页面,可以加载故事板中任意的页面

  • 相关阅读:
    spring4-2-bean配置-2-属性注入细节
    内存管理tcmalloc
    并发视频,怎么hold住高并发
    struts总结
    最近想玩的一个方向
    虚拟化技术漫谈
    陈硕的博客
    木铎
    安全编程资源-苹果
    POOL
  • 原文地址:https://www.cnblogs.com/zhangjingyangjinjin/p/4624887.html
Copyright © 2011-2022 走看看