zoukankan      html  css  js  c++  java
  • iOS界面之间的跳转方式

    iOS界面之间的跳转方式基本有3种。
    1、改变window的根视图
    
      [self.window setRootViewController:VC];
    
    2、模态弹出
    
         [self  presentViewController:nextVC  animated:YES completion:nil];//从当前界面到nextVC
         [self dismissViewControllerAnimated:YES completion:nil];//从nextVC界面回去
    
    3 用 UINavigationController push 进来和pop回去
    
         [self.navigationController pushViewController:nextVC animated:YES];//从当前界面到nextVC这个界面
         [self.navigationController popViewControllerAnimated:YES];//nextVC这个界面回到上一界面
         [self.navigationController popToRootViewControllerAnimated:YES];//回到根视图界面
    
         //self.navigationController.viewControllers 是一个数组里面存放所有之前push过来的界面,如果想要跳回到指定界面 只需要根据索引值取出响应的界面pop回去
    
    
         MainViewController *MainVC =self.navigationController.viewControllers[1];
         [self.navigationController popToViewController:MainVC animated:YES];
  • 相关阅读:
    react-umi 光速上手
    vue 和 react 的区别
    SP12323 NAKANJ
    UVA439 骑士的移动
    NOI 2020 Vlog
    二叉查找树
    可持久化线段树(主席树)
    权值线段树
    YNOI2020 游记
    《四月是你的谎言》语录
  • 原文地址:https://www.cnblogs.com/Free-Thinker/p/7729321.html
Copyright © 2011-2022 走看看