Note that there are some explanatory texts on larger screens.

plurals
  1. POChanging DialogViewController TableView height using monotouch
    text
    copied!<p>Is there a reason why setting TableView.Frame on DialogViewController LoadView method doesn't seem to do anything?</p> <p>Currently to overcome this problem I set TableView.ContentInset for top and TableView.TableFooterView for bottom margins, but the problem with this approach is that scrollbar will not start/end where the table boundaries are, for example it will go "under" the TabBar at the bottom etc.</p> <p>Is there a way to set TableView frame in DialogViewController manually, and if not, why?</p> <p>Thank you.</p> <p>Update: sample code which I expect should work fine, e.g change TableView frame? Note: if I set Frame in ViewDidAppear then it works, but I need it to work in ViewDidLoad.</p> <pre><code>using MonoTouch.Foundation; using MonoTouch.UIKit; using System.Drawing; using MonoTouch.Dialog; namespace Test { [Register ("AppDelegate")] public partial class AppDelegate : UIApplicationDelegate { UIWindow window; public override bool FinishedLaunching (UIApplication app, NSDictionary options) { var vc = new MainViewController (); window = new UIWindow (UIScreen.MainScreen.Bounds); window.RootViewController = vc; window.MakeKeyAndVisible (); return true; } } [Register] public class MainViewController : DialogViewController { public MainViewController (): base (UITableViewStyle.Plain, new RootElement ("")) { TableView.AutoresizingMask = UIViewAutoresizing.None; Section s = new Section ("Section 1"); Root.Add (s); StringElement el = new StringElement ("Element 1"); s.Add (el); el = new StringElement ("Element 2"); s.Add (el); s = new Section ("Section 2"); Root.Add (s); el = new StringElement ("Element 1"); s.Add (el); el = new StringElement ("Element 2"); s.Add (el); } public override void ViewDidLoad () { base.ViewDidLoad (); TableView.Frame = new RectangleF (0, 120, TableView.Frame.Width, TableView.Frame.Height - 120); } } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload