[MonoTouch] UIDocumentInteractionController Question/Problem only with iOS 5.0
Danny Pronk
dpronk at probe-asp.eu
Fri Oct 28 07:27:21 EDT 2011
Hi,
I am using the following code to display the OpenInMenu.
On the iPhone when the UIDocumentInteractionController is shown, you can see
a cancel button, and there things work like clockwork.
However on the iPad (both with iOS 4.3 and iOS 5.0) you see the applications
where you can open the file with, but NO cancel button is visible.
When the OpenInMenu is visible and you click somewhere outside the menu it
disappears but still remains active in memory.
Is my problem related to the RectangleF size or am I missing something
essential how to give the user the dismiss option on the iPad !
The strange thing is that on an iPad with iOS 4.3 things seem to work ok,
but on and iPad with iOS 5.0 the DidDissmissOpenInMenu is NEVER fired.
Please help. (I have found this code on StackOverflow and until iOS 5.0
things worked like expected!
Below you find the code I am using.
using (var pool = new NSAutoreleasePool()) {
UIDocumentInteractionController docControl =
UIDocumentInteractionController.FromUrl(nsurl);
docControl.Delegate = new
Dialogs.UIDocumentInteractionControllerDelegateClass();
docControl.DidDismissOpenInMenu += HandleDocControlDidDismissOpenInMenu;
docControl.DidEndSendingToApplication +=
HandleDocControlDidEndSendingToApplication;
docControl.
docControl.InvokeOnMainThread(
delegate {
if(_webView.IsFirstResponder)
_webView.ResignFirstResponder();
RectangleF theScreenSize = UIScreen.MainScreen.Bounds;
float width = theScreenSize.Width;
bool isValid = docControl.PresentOpenInMenu(new RectangleF(width-40,0,0,20),
_viewController.View,false);
if(!isValid)
{
UIAlertView avAlert = new
UIAlertView(_viewController.Language.FieldValue("reader_title"),
_viewController.Language.FieldValue("reader_message"),
null,_viewController.Language.FieldValue("reader_close"));
avAlert.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin |
UIViewAutoresizing.FlexibleTopMargin;
avAlert.Show();
}
} );
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monotouch/attachments/20111028/ae9192c6/attachment.html
More information about the MonoTouch
mailing list