2013-09-27 83 views
1
工作的UIImagePickerController(相機)

我與需要兩個iOS6的和iOS7 支持UIModalPresentationFormSheetmodalPresentationStyle)未在iOS7工作UIImagePickerController(相機),但它是一個應用程序工作在iOS6中運行良好。UIModalPresentationFormSheet不iOS7

我該怎麼辦?

+0

當您進行此更改時是否收到任何類型的錯誤消息或編譯器錯誤? –

回答

-1

您可以使用下面的代碼從ipad和iphone中獲取來自Camera或Gallery的圖像。就像在ipad中一樣,你無法使用本模式控制器來獲取圖像。

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { 
    UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:picker]; 
    [popover presentPopoverFromRect:self.selectedImageView.bounds inView:self.selectedImageView permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; 
    self.popOver = popover; 
} else { 
    [self presentViewController:picker animated:YES completion:nil]; 
} 
相關問題