【发布时间】:2013-11-22 16:27:29
【问题描述】:
我已阅读此处的所有解决方案,但仍然遇到此问题。我几乎尝试过任何我能想到或找到的东西。
我们刚刚更新为使用 Xcode 4.6.3 中的 Xcode 5.0.2,并且 4.6.3 中的代码可以正常工作。目前我的代码看起来像这样。这是过去的工作,我又回到了这个,因为没有其他任何工作。
此时大小是正确的,但它在屏幕的右上角。
我也试过添加
actionViewController.View.Center = this.View.Center;
但它并没有改变中心。任何帮助是极大的赞赏。我现在快疯了:)
IStoryboard storyBoard = UIStoryboard.FromName ("WorkOrderActions_iPad", null);
VZWOActionViewController actionViewController = (VZWOActionViewController)storyBoard.InstantiateViewController ("VZWOActionViewController");
actionViewController.ModalPresentationStyle = UIModalPresentationStyle.PageSheet;
actionViewController.actionViewControllerID = actionViewControllerName;
this.PresentViewController (actionViewController, true, completionHandler: null);
if (actionViewController.View.Superview != null) {
actionViewController.View.Superview.AutoresizingMask = UIViewAutoresizing.FlexibleMargins;
actionViewController.View.Superview.Bounds = new RectangleF (0.0f,0.0f, 924.0f, 648.0f);
}
【问题讨论】:
-
页面表单会发生这种情况,页面表单不会居中,表单工作正常,因此您可以使用表单表单,或者您应该移动超级视图,以便视图看起来居中。这是页面表的解决方法
标签: ios modalviewcontroller presentmodalviewcontroller