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); 
     } 

ありがとう:

は、ここでは、コードです。

答えて

1

私はいくつかの提案があります。まず、UIPopoverControllerをメンバー変数にして、収集されないようにします。

第2に、ピッカーでContentSizeForViewInPopoverを呼び出しました。

picker.ContentSizeForViewInPopover = new SizeF(this.View.Frame.Width,this.View.Frame.Height); 

最後に、PresentFromRect呼び出しの画面の左上に0x0の矩形を使用します。

_popover.PresentFromRect(new RectangleF (0,0,0,0),this.View,UIPopoverArrowDirection.Up,true);