0

不確定是否有人可以幫助我。UIModalPresentationFormSheet中的UINavigation

我想創建一個帶導航的UIModalPresentationFormSheet。我可以加載視圖,但我不知道如何設置導航控制器,以便在tableloaded中的一行加載編輯屏幕。目前它從主屏幕上加載一個帶有tableview的uiviewcontroller。我需要允許在表格上進行編輯以添加/編輯刪除記錄。當用戶點擊添加或編輯一個新的uiviewcontroller(細節視圖)被推到屏幕。如果我有一個導航控制器,會更好嗎?但我確實需要編輯按鈕,然後回到中殿酒吧。

我覺得我有按鈕,增加工作的更多的只是建立navigationcontroller

RootViewController的 - TableView中選擇它加載DetailViewController

DetailViewContoller行 - 的DetailView - 包含加載FormView控件作爲一個按鈕UIModalPresentationFormSheet請參閱下面的鏈接。表格視圖 - 加載UIModalPresentationFormSheet 表格 - 其中包含數據的表格視圖。編輯這個數據加載FormDetailView http://www.bronron.com/iphoneDev/screen1.png

FormDetail視圖 - 視圖 - 控制與保存和取消按鈕殿欄上 ​​

任何幫助將不勝感激。提前感謝

感謝, AZZ

回答

1

當加載UIModalPresentationFormSheet港前賽績,只需添加:

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:/*the formsheet*/]; 

然後,只需添加navController到模式的看法,而不是根視圖。然後你就可以添加按鈕和推viewControllers等

+0

像這樣的事情?系統映像控制器*控制器= [[[SystemPickerViewController alloc] initWithNibName:@「SystemPickerViewController」bundle:nil] autorelease]; controller.delegate = self; controller.modalPresentationStyle = UIModalPresentationFormSheet; controller.originalSystemName = currentSystem; UINavigationController * navController = [[UINavigationController alloc] initWithRootViewController:controller]; [self presentModalViewController:controller animated:YES]; –

+0

是的,就是這樣;除了將最後一行改爲:'self presentModalViewController:navController animated:YES];' – Andrew

+0

我這樣做了,它似乎不加載迷你視圖(UIModalPresentationFormSheet),它像一個普通的桌面視圖加載,例如屏幕的全尺寸 –

0

UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:viewController]; nav.modalPresentationStyle = UIModalPresentationFormSheet;

相關問題