我用来开发应用程序 MonoTouch Iphone,但使用 UIPopoverController 时遇到问题。我无法打开页面来选择照片。我使用 camera.cs TweetStation 类。
这是代码:
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);
}
谢谢你的帮助。