Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A slideout navigation control for Xamarin.iOS

License

NotificationsYou must be signed in to change notification settings

Baseflow/Xamarin-Sidebar

A slideout navigation control for Xamarin iOS applications.

licenseBuild statusNuGetGitHub tagMyGet

Get the package onNuget!

If you're using Sidebar Navigation send me a link to your app and I'll happily post it here.

Menu Open

This is partly based on two other good slideout menu implementation that each didn'tprovide quite what I was looking for. Those two areFlyoutNavigationandSlideoutNavigation.

Xamarin-Sidebar allows you to provide one UIViewController to be used as a content viewand another to be used as a menu. When you open the menu the content view will slide overto reveal the provided menu UIViewController.

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

RootViewController.cs

usingSidebarNavigation;...public partialclassRootViewController:UIViewController{// the sidebar controller for the apppublicSidebarControllerSidebarController{get;privateset;}publicoverridevoidViewDidLoad(){base.ViewDidLoad();// create a slideout navigation controller with the top navigation controller and the menu view controllerSidebarController=newSidebarController(this,newContentController(),newSideMenuController());}}...

AppDelegate.cs

...public overrideboolFinishedLaunching(UIApplicationapp,NSDictionaryoptions){window=newUIWindow(UIScreen.MainScreen.Bounds);// set our root view controller with the sidebar menu as the apps root view controllerwindow.RootViewController=newRootViewController();window.MakeKeyAndVisible();returntrue;}...

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(newOtherContentController());};

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

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

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

About

A slideout navigation control for Xamarin.iOS

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Contributors12

Languages


[8]ページ先頭

©2009-2025 Movatter.jp