2016-02-26 112 views
1

我顯示在我的viewcontroller在表格,但默認大小超過我需要,因此,我試圖調整大小,以符合我的要求,但沒有任何改變。Resize FormSheet不受影響

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; 
}); 

回答

1

如果我在ViewDidLoad()方法設置PreferredContentSize,那麼它的工作原理。確保你的部署目標是iOS8.0 +

public override void ViewDidLoad() 
{ 
    base.ViewDidLoad(); 
    TableView.Source = new TableSource(); 
    this.PreferredContentSize = new CGSize(620, 220); 
}