zoukankan      html  css  js  c++  java
  • ios ViewController 页面跳转

    从一个Controller跳转到另一个Controller时,一般有以下2种: 
    1、利用UINavigationController,调用pushViewController,进行跳转;这种采用压栈和出栈的方式,进行Controller的管理。调用popViewControllerAnimated方法可以返回。 

        PickImageViewController *ickImageViewController = [[PickImageViewController alloc] init]; 
        [self.navigationController pushViewController: ickImageViewController animated:true]; 
        [ickImageViewController release]; 


    2、利用UIViewController自身的presentModalViewController,进行跳转;调用dismissModalViewControllerAnimated方法可以返回。 
        PickImageViewController *ickImageViewController = [[PickImageViewController alloc] init]; 
        [self presentModalViewController:ickImageViewController animated:YES]; 
      //返回 
        [self dismissModalViewControllerAnimated:YES];

    3、用StoryBoard的Segue直接可视化连接不同的ViewController”,并且将segue的id叫做“welcome“。然后在代码里写以下的代码

    [self performSegueWithIdentifier:@"welcome" sender:self];

    备注:
      方法1和2适用于旧版的nib文件页面
      方法3使用于storyboard

  • 相关阅读:
    菜鸟学存储:网络存储IP SAN与IB SAN
    读xml高手
    预先加载图片
    xred520
    最简单准确的硬盘整数分区设置操作方法
    Google 每天处理约 20000TB 的数据
    IE 8 无法正常使用网站后台编辑器问题
    常用的JS技术1
    adodb stream 使用说明
    [Tools] JDGUI(Java Decompiler)
  • 原文地址:https://www.cnblogs.com/JayK/p/3922338.html
Copyright © 2011-2022 走看看