2013-04-12 74 views
0

我有iPad應用程序與主視圖控制器頂部的導航欄。我想在導航欄上創建一個登錄按鈕,該按鈕應該打開一個帶有用戶名,密碼,一個額外字段和一個登錄按鈕的彈出視圖。單擊登錄按鈕將關閉彈出窗口並將信息從文本字段傳遞迴主視圖控制器。iPad彈出窗體

我一直在試圖在網上找到這樣的東西,但沒有運氣。

有沒有人知道一種方法來做到這一點?

+0

究竟是什麼問題? – Matthias

回答

0

你應該看看UIPopoverController

這是你如何初始化,並顯示:

UIPopoverController *myPopover = [[UIPopoverController alloc] initWithContentViewController:myForm]; 
[myPopover presentPopoverFromRect:button.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionsAny animated:YES]; 

獲取數據從您可能想使用delegationmyForm回來。

myForm.delegate = self; //before presenting de popover