2011-03-18 72 views
1

我有興趣從包含兩個其他導航控制器的標籤欄啓動imagePickerController。我這樣做是因爲我喜歡一個頁面上的多個縮略圖。我無法弄清楚如何將imagePicker放在標籤欄數組中,因爲它必須以模態方式啓動。從TabBar啓動imagePicker

//load imagePicker 
imgPicker = [[UIImagePickerController alloc] init]; 
imgPicker.editing = YES; 
imgPicker.delegate = self; 
imgPicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; 


//add navigation controllers to tab bar controller 
tabBarController.viewControllers = [NSArray arrayWithObjects:contactNavController, mapNavController, nil]; 

//設置tabBarController作爲窗口 的RootViewController的[窗setRootViewController:tabBarController];

讓我知道你是否有任何建議?

感謝,

傑克

回答

0

UIImagePicker從UIViewController的繼承所以它應該是罰款,只需將其添加到您正在創建tabBarController.viewcontrollers陣列。