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]; //弹出后返回到原视图

  • 相关阅读:
    Jedis测试redis
    jedis池的作用
    错误
    Ceph剖析:数据分布之CRUSH算法与一致性Hash
    drools规则引擎初探
    Techniques for HA IT Management
    django_simple_captcha使用笔记
    微服务架构的理论基础
    分布式系统服务的稳定性
    四层、七层负载均衡的区别
  • 原文地址:https://www.cnblogs.com/luoyubuku/p/3822050.html
Copyright © 2011-2022 走看看