Is there a reason why setting TableView.Frame on DialogViewController LoadView method doesn't seem to do anything?
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.
Is there a way to set TableView frame in DialogViewController manually, and if not, why?
Thank you.
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.
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);
}
}
}