我是iOS開發新手。我想使用UINavigationController從一個視圖移動到另一個視圖。請告訴我,如果可能或不可以,如何?在iOS中使用UINavigationController打開另一個視圖
-4
A
回答
1
試試這個下面的代碼:
SecondVC *detailView = [[SecondVC alloc] initWithNibName:@"SecondVC" bundle:nil];
[self.navigationController pushViewController:detailView animated:YES];
[detailView release];
0
使用方式如下:
.h文件中
#import "SecondViewController.h"
.m文件
- (IBAction)gotoSecondView:(id) sender
{
NSLog(@"I am going to Second View");
SecondViewController *SecondView = [[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil];
[self.navigationController pushViewController:SecondView animated:YES];
[SecondView release];
}
對於故事板:
SecondViewController* SecondView = [self.storyboard instantiateViewControllerWithIdentifier:@"SecondViewController"];
[self presentModalViewController:SecondView animated:YES];
相關問題
- 1. 在UINavigationController中推送另一個視圖?
- 2. Recycler View - 一個視圖打開另一個視圖
- 3. 在另一個UINavigationController中的UITabBarController中使用UINavigationController的問題
- 4. 使用UINavigationController導航到另一個視圖
- 5. 從一個UINavigationController接口到另一個UINavigationController(Swift iOS 9,xcode 7)
- 6. 在UITabBarController中打開一個視圖
- 7. 在iOS中的多個視圖中使用UINavigationController中的固定背景圖像?
- 8. 在另一個選項卡中打開視圖 - iphone
- 9. 在WPF的xaml視圖中打開另一個窗口
- 10. 在新任務中打開另一個視圖WPF caliburn.micro c#
- 11. 在另一個視圖中打開電影流
- 12. 在另一個視圖中使用一個視圖gsp gsp
- 13. iOS-使用SWRevealViewController打開後視圖時使前視圖變暗
- 14. UINavigationController的根視圖(IOS)
- 15. 如何從基於視圖的應用程序中打開另一個視圖
- 16. iOS UIViewController麻煩打開另一個uwwcontoller
- 17. 打開從另一個(IOS)的申請
- 18. 在另一個視圖上查看IOS
- 19. 在另一個iOS上滑動視圖
- 20. 打開另一視圖與卡利微
- 21. UINavigationController使一個視圖模態
- 22. WPF MVVM打開一個從另一個視圖
- 23. 的iOS:可以在一個視圖中看到在另一個
- 24. 通過UIButton(UINavigationController)從一個視圖推送到另一個視圖
- 25. UITabBarController似乎打開一個視圖,然後關閉另一個視圖
- 26. 如何使表單視圖從另一個表單視圖打開只讀odoo
- 27. 使用意圖從另一個URL打開一個網址?
- 28. 如何在視圖中打開另一個應用程序中的文檔
- 29. 打開另一個視圖並取消後選中單元格
- 30. Android - 打開藍牙設置,但在另一個視圖
當然,這是可能的...你想使用,故事情節是什麼? Xib?只有代碼? –
Xib和唯一代碼。 – Indra