开发者

MonoTouch and UIPopoverController

开发者 https://www.devze.com 2023-01-16 07:39 出处:网络
I have a iPad app with the following code tied to a button\'s (bMyDocuments) TouchDown event handler:

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

0

精彩评论

暂无评论...
验证码 换一张
取 消