MonoTouch 和 UIPopoverController
我有一个 iPad 应用程序,其以下代码绑定到按钮的 (bMyDocuments) TouchDown 事件处理程序:
UIPopoverController uipoc = new UIPopoverController(new Pop2());
uipoc.PopoverContentSize = new SizeF(200f, 300f);
uipoc.PresentFromRect (bMyDocuments.Frame, v, UIPopoverArrowDirection.Up, true);
Pop2 是一个具有默认视图(白色背景,无 ui 元素)的空白 UIViewController。
此代码从按钮生成一个弹出窗口,并且大小正确。但是,该应用程序挂起时没有任何错误,并且在其外部单击时弹出窗口不会消失。
如何正确初始化 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 UIViewController 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
垃圾收集器很可能正在吞噬您的 UIPopoverController。尝试将 UIPopovercontroller 声明为类变量,而不是在 TouchDown 事件中声明,看看效果如何。
干杯,
克里斯NTR
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