46 ratings
  • 1
  • 2
  • 3
  • 4
  • 5
5 star 35
4 star 2
3 star 0
2 star 4
1 star 5
Compatible with
  • iOS

Sidebar Navigation 1.9

Jack Dehlin

An easy to use and versatile slideout menu.

Sidebar Navigation

Sidebar Navigation allows you to provide one UIViewController to be used as a content view and another to be used as a menu. When you open the menu the content view will slide over to reveal the provided menu UIViewController.

From the side menu you can easily change the content UIViewController or push UIViewControllers onto a UINavigationController.

To set it up just create a root UIViewController and a SidebarController, passing in your content and menu controllers.

RootViewController.cs

using SidebarNavigation;
...
public partial class RootViewController : UIViewController
{
    // the sidebar controller for the app
    public SidebarController SidebarController { get; private set; }

    public override void ViewDidLoad()
    {
        base.ViewDidLoad();

        // create a slideout navigation controller with the top navigation controller and the menu view controller
        SidebarController = new SidebarController(this, new ContentController(), new SideMenuController());
    }
}
...

AppDelegate.cs

...
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
    window = new UIWindow(UIScreen.MainScreen.Bounds);

    // set our root view controller with the sidebar menu as the apps root view controller
    window.RootViewController = new RootViewController();

    window.MakeKeyAndVisible();
    return true;
}
...

In the content controller you can add a button to open the slideout menu.

menuButton.TouchUpInside += (sender, e) => {
    SidebarController.ToggleMenu();
};

In the side menu controller you can add buttons to change the content view.

otherContentButton.TouchUpInside += (sender, e) => {
    SidebarController.ChangeContentView(new OtherContentController());
};

Additional options include hiding the shadow, setting the menu width, and placing the menu on the left.

SidebarController.HasShadowing = false;
SidebarController.MenuWidth = 220;
SidebarController.MenuLocation = SidebarController.MenuLocations.Left;

See the sample projects included in the source for more details.

Release Notes

New Features

  • Ability to disable the Sidebar
  • Swipe gesture area can be set through a property
  • Added a Storyboard sample project

Bug Fixes

  • Shadow now shows up for left menu as well
  • Gesture recognizers properly removed when changing views
Write a Review

26 reviews

Evgenii Emelyanov rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Very simple to use.

For those who got trouble with content width: in Visual Studio (or Xamarin Studio) you should create RootViewController as Empty Class (not ViewController) to prevent VS of creating .xib of RootViewController.

Posted on: June 22 / Version: 1.9
Timothy Delaney

Hi Jack,

I'm having an issue when the contentviewcontroller contains a UITableView for some reason I cannot rearrange items in my table. If i remove the rootviewcontroller and use a regular uinavigationalcontroller as my rootviewcontroller the list works fine. Any help would be greatly appreciated.

Thanks Tim

Posted on: December 7, 2016 / Version: 1.9
Francisco Gutierrez

It's very good, but I think it's unable to resize the content when it's in landscape

Posted on: December 6, 2016 / Version: 1.9
Dipen Hansawala

How Can I Add Left and Right Navigation at same time ?.. If i Add both it'll only accept 1 side Swipe Recognizer recognizer ... can any 1 help for it..?

Posted on: November 22, 2016 / Version: 1.9
Sarath Nagesh rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Works great, thank you. In your post below, you said.. for Left Menu

MenuLocation = SidebarController.MenuLocations.Left

while its actaully

MenuLocation = SidebarNavigation.MenuLocations.Left

And it possible for it to act as SplitView in iPad??

Posted on: August 6, 2016 / Version: 1.9
Charlie Finlayson rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Very happy with the easy setup for this component! I needed a permanently open sidebar, so I just used SidebarController.OpenMenu() in ViewDidLoad().

Posted on: May 22, 2016 / Version: 1.9
David Denning rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Thanks David Beni - that worked for me! saved me a lot of effort!

Posted on: April 18, 2016 / Version: 1.9
Tishawn Fahie rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

This works great! Thank you so much for this.

Posted on: December 8, 2015 / Version: 1.9
GEORGIOS GOURNIANAKIS rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Exactly what i needed! Thanks

Posted on: October 22, 2015 / Version: 1.9
efm mobile

Hi, Im using the component and I want to move the three-lines icon to the left side of the SideBar.

How could I do that? thanks

Posted on: October 14, 2015 / Version: 1.9
tagmsb

How to disable the side menu for a particular screen (like login and logout). I need to just hide the side menu navigation for a particular screen

Posted on: September 14, 2015 / Version: 1.9
Anthony Scolaro rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

How can I use this with storyboards?

Posted on: September 3, 2015 / Version: 1.8
Vlad rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

This component works fine on iPhone 5, but on all other devices it resizes content view incorrectly:

on iPhone 4 content view is smaller than phone screen; on iPhone 6 content view is bigger than phone screen; I'm not sure if it is related to constraints, but if I set the same view controller as root in appDelegate without sidebar navigation - everything looks fine.

Posted on: August 7, 2015 / Version: 1.8
Rafael Nicoleti

Hi, this lib monotouch is old in new version Xamarin, i can't using my projects because dont is compatibility.

Some solution?

Posted on: July 31, 2015 / Version: 1.8
David Beni rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Tip for having both a right and left menu :

RootViewController.cs

public override void ViewDidLoad() { base.ViewDidLoad();

        UIViewController subRootVC = new UIViewController() ;
        UIViewController mainVC=...;
        UIViewController rightVC=...;
        UIViewController leftVC=...;

        rightSidebarController = new SidebarController(subRootVC, mainVC, rightVC)
        {
            HasShadowing = true,
            MenuWidth = 280,
            MenuLocation = SidebarController.MenuLocations.Right
        };

        leftSidebarController = new SidebarController(this, subRootVC, leftVC)
        {
            HasShadowing = true,
            MenuWidth = 280,
            MenuLocation = SidebarController.MenuLocations.Left
        };
    }
Posted on: July 13, 2015 / Version: 1.8
Steve Triano rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Excellent product and excellent response from Jack. I had an issue & within minutes of posting a question he had me working!

Posted on: June 16, 2015 / Version: 1.7
Timo Virtanen rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

This is brilliant! Thank you.

Posted on: May 31, 2015 / Version: 1.7
Charles Bockelmann rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Hi,

Same as LP Post.

Posted on: March 9, 2015 / Version: 1.7
James Nguyen rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Same as below.

Posted on: January 20, 2015 / Version: 1.5
LP Post

Hi,

I'm getting the following error when using Xamarin-Sidebar-Unified dll and Xamarin.iOS: {System.MissingMethodException: Method not found: 'UIKit.UIGestureRecognizer.set_Delegate'. at SidebarNavigation.SidebarController.Initialize (UIKit.UIViewController currentViewController, UIKit.UIViewController navigationViewController) [0x00000] in :0 at SidebarNavigation.SidebarController..ctor (UIKit.UIViewController rootViewController, UIKit.UIViewController contentAreaController, UIKit.UIViewController navigationAreaController) [0x00000] in :0 at NavigationSample.RootViewController.ViewDidLoad () [0x00027] in RootViewController.cs } System.MissingMethodException

Any help please!!

Posted on: January 15, 2015 / Version: 1.5
Alex Reyes rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Really nice job! MvvmCross demo project here: https://github.com/alexrainman/MvvmCross.FlyOutMenu

Any plans on unified API support?

Posted on: January 10, 2015 / Version: 1.4
Has rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Great work, thanks heaps

Posted on: November 25, 2014 / Version: 1.4
Sam rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Brilliant component, Will it have unified api support soon ?

Posted on: November 11, 2014 / Version: 1.4
pilouk rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

No more rotation issue ! works great with storyboard too.

Thanks man!

Posted on: October 10, 2014 / Version: 1.3
Sven Reißenweber rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Massiv rotation issues (IPad). Unusable

Posted on: September 12, 2014 / Version: 1.2
Burak Ogutken rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Jack thank you for this great component, I finished one football club application with this component.

Posted on: August 7, 2014 / Version: 1.1