MonoTouch and UIPopoverController
I have a iPad app with the following code tied to a button's (bMyDocuments) TouchDown event handler:
UIPopoverController uipoc = new UIPopoverController(new Pop2());
uipoc.PopoverContentSize = new SizeF(200f, 300f);
uipoc.PresentFromRect (bMyDocuments.Frame, v, UIPopoverArrowDirection.Up, true);
Pop2 is a blank UIViewControll开发者_StackOverflow中文版er with the default view (white background, no ui elements).
This code produces a popover from the button, and the size is correct. However the app hangs without any errors, and popover won't disappear when clicking outside of it.
How can I initialize UIPopoverController correctly? Sample code?
thanks,
pom
Chances are that the garbage collector is eating up your UIPopoverController. Try declaring your UIPopovercontroller as a class variable instead of inside your TouchDown event and see how that goes.
Cheers,
ChrisNTR
精彩评论