Example #1
0
 public override void ViewDidLoad()
 {
     base.ViewDidLoad();
     this.View.BackgroundColor = UIColor.Red;
     // create a slideout navigation controller with the top navigation controller and the menu view controller
     NavController = new NavController();
     NavController.PushViewController(new IntroController(), false);
     SidebarController                = new SidebarNavigation.SidebarController(this, NavController, new SIdeMenuController());
     SidebarController.MenuWidth      = 100;
     SidebarController.ReopenOnRotate = false;
 }
Example #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.
            base.ViewDidLoad();
            View.BackgroundColor = UIColor.FromRGB(.9f, .9f, .9f);

            var title = new UILabel(new RectangleF(0, 50, 230, 20));

            title.Font          = UIFont.SystemFontOfSize(24.0f);
            title.TextAlignment = UITextAlignment.Center;
            title.TextColor     = UIColor.Blue;
            title.Text          = "Menu";

            var body = new UILabel(new RectangleF(30, 70, 170, 100));

            body.Font          = UIFont.SystemFontOfSize(12.0f);
            body.TextAlignment = UITextAlignment.Center;
            body.Lines         = 0;
            body.Text          = @"This is the side menu. You can use any UIViewController to put whatever you want here!";

            var introButton = new UIButton(UIButtonType.System);

            introButton.Frame = new RectangleF(0, 180, 230, 20);
            introButton.SetTitle("Intro", UIControlState.Normal);
            introButton.TouchUpInside += (sender, e) =>
            {
                NavController.PopToRootViewController(false);
                SidebarController.CloseMenu();
            };

            var contentButton = new UIButton(UIButtonType.System);

            contentButton.Frame = new RectangleF(0, 220, 230, 20);
            contentButton.SetTitle("Content", UIControlState.Normal);
            contentButton.TouchUpInside += (sender, e) =>
            {
                NavController.PushViewController(new ContentController(), false);
                SidebarController.CloseMenu();
            };

            View.Add(title);
            View.Add(body);
            View.Add(introButton);
            View.Add(contentButton);
        }