zoukankan      html  css  js  c++  java
  • IOS页面切换方式

    1  模态(model)

      //进入B页面(在A页面写以下代码)

        (1)  B页面名 *VC=[[B页面名 alloc] init];

              VC.modalTransitionStyle=UIModalTransitionStyleCoverVertical;

    或(2)  B页面名 *VC=[[B页面名 alloc] initWithNibName:@"B页面名" bundle: nil];

         [self presentModalViewController:zhuchu animated:YES];//显示模态画面

      //返回A页面(在B页面写以下代码)

         [self dismissModalViewControllerAnimated:YES];//关闭模态画面

    2  SwitchViewController (同时启动两个画面)

          self.view insertSubview:(加载的新页面) atIndex:n;

         提示:n表示加载到那一层上面

                 多用于在一个页面中有时要显示或隐藏某个View会遮挡

    3  UITabBarController(实现并列画面跳转)

          self.tabBarController.viewControllers = @[navFrist, navSecond,navThird,navFourth,navFifth];   

          self.window.rootViewController = self.tabBarController;

          [self.window addSubview:self.tabBarController.view];//将根控制器的视图加到应用程序主窗口

    4  UINavigationController(实现多层画面跳转),在导航控制器中,载入有层级关系的界面

     //进入B页面(在A页面写以下代码)

          B页面名 *addSymbol=[[B页面名  alloc] initWithNibName:@"B页面名" bundle: nil];

          [self.navigationController pushViewController:addSymbol  animated:YES];

     //返回A页面(在B页面写以下代码)

          [self.navigationController popViewControllerAnimated:YES]; //弹出后返回到原视图

  • 相关阅读:
    依赖注入
    ToDictionary() and ToList()
    Middleware详解
    仓储层的搭建
    Controller和View的交互
    Configuration配置信息管理
    开发工具
    60分钟Python快速学习(转)
    oracle PL/SQL(procedure language/SQL)程序设计之函数+过程+包(转)
    ssh无密码登陆(转)
  • 原文地址:https://www.cnblogs.com/luoyubuku/p/3822050.html
Copyright © 2011-2022 走看看