I'm using a Monotouch.Dialog based ui but I need a fixed UIToolBar at the
bottom of the tableview. This seems to be a not uncommon problem.

Has anyone got this to work and would care to share the secret?

Cheers,
Felix

I looked on the web...

http://stackoverflow.com/questions/9763196/monotouch-dialog-add-a-toolbar-at-the-bottom-of-the-dialog
http://stackoverflow.com/questions/4321295/setting-monotouch-dialog-uitableview-position

Unfortunately the answers given in these posts are not helpful. I've tried
adding a UIToolbar and a DialogViewController to another parent
UIViewController inheritor in its constructor.

                        DialogViewController = new 
DialogViewControllerEx(UITableViewStyle.Plain,
null, true);
                        Toolbar = new UIToolbar();

                        View.Add(Toolbar);
                        View.Add(DialogViewController.View);

I then set up the sizes in ViewDidAppear.

                protected void ResizeViews()
                {
                        // Set the toolbar and webview heights

                        DialogViewController.View.Frame = new 
System.Drawing.RectangleF
                        (
                                View.Bounds.Location,
                                new System.Drawing.SizeF(View.Bounds.Width, 
View.Bounds.Height -
ToolBarHeight)
                        );

                        Toolbar.Frame = new System.Drawing.RectangleF
                        (
                                new 
System.Drawing.PointF(View.Bounds.Location.X, View.Bounds.Height -
ToolBarHeight),
                                new System.Drawing.SizeF(View.Bounds.Width, 
ToolBarHeight)
                        );

                }


 From what I understand, this approach doesn't work because the
UITableviewController base of DialogViewController overrules the sizing and
makes the table go all the way to the bottom. I started trying to copy the
DialogViewController code and reimplement with it inheriting
UIViewController rather than UITableViewController. Unfortunately it
accesses properties of RootElement marked internal. So I copied RootElement
but then Element has methods that take a DialogViewController so I realised
that I was going to have to copy the whole MT.Dialog Code base just to get
this to work. Which seems a bit crazy.  


--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/Monotouch-Dialog-DialogViewController-and-UIToolBar-Can-they-coexist-tp4655712.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to