1

在我的应用程序中,我的 TableCell 上有一个 Longpress 手势。在 Lonpress 上会打开一个 Popover。Popover 会触发 NavigationController。这是代码:

var navigationController = new UINavigationController();

//Page 1 
var contPage1 = new UIViewController();
this._movePicker = new UIDatePicker();
var btnPage1 = new UIButton();
btnPage1.Frame = new RectangleF(0,260, 300,40);
contPage1.View.AddSubview(this._movePicker);
contPage1.View.AddSubview(btnPage1);

//Page 2
var contPage2 = new UIViewController();
var btnPage2 = new UIButton();
var textField = new UITextField();
textField.Frame = new RectangleF(0,35,300,150);
btnPage2.Frame = new RectangleF(0,260,300,40);
contPage2.View.AddSubview(btnPage2);
contPage2.View.AddSubview(textField);

// startPopover
this.PopoverController = new UIPopoverController(navigationController);
this.PopoverController.PopoverContentSize = new SizeF(300,340);
//Navigate on the first site
navigationController.PushViewController(contPage1, true);
btnPage1.TouchUpInside(s,e) => navigationController.PushViewController(contPage2, true);

this.PopoverController.PresentFromRect(locationinView, btn, UIPopoverDirection.Any, true);

好的。这工作正常。出现一个弹出框。在 FirstView 上,我单击按钮,它会将我导航到第二页。之后键盘出现,我可以在文本字段中写一些东西。如果我关闭键盘,弹出框会改变他的大小。它现在占据了 iPad 显示屏的整个高度。

但是为什么要调整大小。我将 Popover 的大小设置为 300、400

4

0 回答 0