iOS界面跳轉

從一個Controller跳轉到另外一個Controller時,通常有如下2種: 
一、利用UINavigationController,調用pushViewController,進行跳轉;這種採用壓棧和出棧的方式,進行Controller的管理。調用popViewControllerAnimated方法能夠返回。 

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


二、利用UIViewController自身的presentModalViewController,進行跳轉;調用dismissModalViewControllerAnimated方法能夠返回。 
    PickImageViewController *ickImageViewController = [[PickImageViewController alloc] init]; 
    [self presentModalViewController:ickImageViewController animated:YES]; 
//返回 
[self dismissModalViewControllerAnimated:YES];it

相關文章
相關標籤/搜索