1
我用来开发一个应用程序MonoTouch Iphone,但我有一个使用UIPopoverController的问题。我无法打开页面来选择照片。 我使用了camera.cs TweetStation类。UIPopoverController和UIImagePickerController Monotouch问题
下面的代码:
public static void SelectPicture (UIViewController parent, Action<NSDictionary> callback)
{
if(OzytisUtils.isIpad()){
picker = new UIImagePickerController();
UIPopoverController popover = new UIPopoverController(picker);
picker.Delegate = new CameraDelegate();
picker.SourceType = UIImagePickerControllerSourceType.PhotoLibrary;
popover.SetPopoverContentSize(new SizeF(parent.View.Frame.Width,parent.View.Frame.Height),true);
if(popover.PopoverVisible){
popover.Dismiss(true);
picker.Dispose();
popover.Dispose();
}else{
popover.PresentFromRect(parent.View.Frame,parent.View,UIPopoverArrowDirection.Right,true);
}
}else{
Init();
picker.SourceType = UIImagePickerControllerSourceType.PhotoLibrary;
_callback = callback;
parent.PresentModalViewController (picker, true);
}
感谢您的帮助。