Ios 调整表单大小不会受到影响
我在表单中的viewcontroller中显示,但默认大小超出了我的需要,因此,我尝试调整大小以符合我的要求,但没有任何更改Ios 调整表单大小不会受到影响,ios,xamarin,Ios,Xamarin,我在表单中的viewcontroller中显示,但默认大小超出了我的需要,因此,我尝试调整大小以符合我的要求,但没有任何更改 var vc = new WSViewController(); vc.ModalPresentationStyle = UIModalPresentationStyle.FormSheet; vc.ModalTransitionStyle = UIModalTransitionStyle.CrossDissolve; PresentViewController(vc,
var vc = new WSViewController();
vc.ModalPresentationStyle = UIModalPresentationStyle.FormSheet;
vc.ModalTransitionStyle = UIModalTransitionStyle.CrossDissolve;
PresentViewController(vc, true, () => {
vc.View.Superview.Frame = new CGRect(0, 0, 200, 200);
vc.View.Superview.Center = View.Center;
});
如果我在
ViewDidLoad()
方法中设置了PreferredContentSize
,那么它就会工作。确保您的部署目标是iOS8.0+
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
TableView.Source = new TableSource ();
this.PreferredContentSize = new CGSize(620, 220);
}