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

  • 相关阅读:
    获取微信接口各种信息
    servlet
    springmvc上传图片,发送邮件
    linuxmint卸载软件
    linuxmint更改权限
    screen 链接远程桌面
    eclipse添加桌面快捷方式
    window精选软件
    windows Server2012 IIS8.0配置安装完整教程
    SQL Server 2012 sa 用户登录 18456 错误
  • 原文地址:https://www.cnblogs.com/luoyubuku/p/3822050.html
Copyright © 2011-2022 走看看