如何在iOS的弹出窗口中打开相机胶卷?

时间:2013-07-03 11:15:48

标签: ios objective-c cocoa-touch imessage camera-roll

我开发了一个消息传递应用程序,并希望在弹出窗口中打开一个类似于iMessage应用程序的Camera Roll界面: enter image description here

如何实现此功能?

1 个答案:

答案 0 :(得分:4)

希望这适合你

//初始化图像选择器并添加到弹出控制器

  UIImagePickerController* imagePickerController= [[UIImagePickerController alloc] init];   
    imagePickerController.delegate=self;    
    imagePickerController.sourceType= UIImagePickerControllerSourceTypePhotoLibrary; 
popoverController= [[UIPopoverController alloc] initWithContentViewController:imagePickerController];
   [popoverController presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];