Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to change MonoTouch.Dialog Size or Move it inside another view ?

$
0
0

I'm new to IOS development, and I'm building Ipad app using split view.

Its very simple and works fine; Detail part of the split view has UINavigationController that displays (push/pops) DialogViewController based on MasterView selection (as navigation menu).

Problem is, I can not resize or move the MonoTouch.Dialog TableView; for example I tried;

   public class LoginDvc : DialogViewController{

        public LoginDvc(): base(UITableViewStyle.Grouped, null)
        {
            var myButton = UIButton.FromType(UIButtonType.RoundedRect);
            myButton.SetTitle("Login", UIControlState.Normal);
            myButton.Frame = new RectangleF(0, 0, 320, 44);
            myButton.DefaultStyle();

            Root = new RootElement("Login") {
                new Section ("") {
                    new EntryElement ("Email:", "", ""),
                    new EntryElement ("Password :", "", "", true),
                   new BooleanElement ("Remember Me", false)
                }, new Section ("") {
                                    myButton
                }
            };

        } 

       public override void LoadView()
        {
        base.LoadView();
            TableView.BackgroundView = null;
        TableView.BackgroundColor = UIColor.Clear;
            this.TableView.Frame = new RectangleF(200, 200, 400, 400);

//           var frame = this.View.Frame;
//          frame.Width= 500;
//          frame.Height = 600;
//          this.View.Frame = frame;
        }
}

[I tried resizing the UINavigationController (seems to be a bad idea) ] (http://stackoverflow.com/questions/2826507/how-to-resize-a-uinavigationcontroller-in-iphone)

Also I tried taking UINavigationController out and replacing it with resized UIView as a container for the detail DialogViewController, that didn't work either.

ex;

public partial class RootVc : UISplitViewController
{
   private void SetDetailView(DialogViewController detail)
   {
            var detailContainer = new UIViewController();
            detailContainer.View.Frame = new RectangleF(100,100,300,400);
            detailContainer.View.AddSubview(detail.View);

            ViewControllers = new UIViewController[] { _masterView, detailContainer  };
   }

}

I appreciate any help on this. :)


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>