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);
}
感謝您的幫助。