apploft / aplslidemenu Goto Github PK
View Code? Open in Web Editor NEWSliding Hamburger Menu like the one in the Facebook App
License: MIT License
Sliding Hamburger Menu like the one in the Facebook App
License: MIT License
I am switching the contentViewController when a row is selected in my left menu. If the app is in portrait, the left menu should close, and it does. When in landscape, the left menu should stay open, but it closes and leaves me with a black bar on the right side of the screen.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == 0) {
FirstViewController *fvc = [[FirstViewController alloc]initWithNibName:@"FirstViewController" bundle:nil];
UINavigationController *navController = [[UINavigationController alloc]initWithRootViewController:fvc];
navController.delegate = dvc;
self.slideMenuController.contentViewController = navController;
if (UIDeviceOrientationIsPortrait([[UIDevice currentDevice]orientation])) {
[self.slideMenuController hideMenu:YES];
}
} else {
SecondViewController *svc = [[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil];
UINavigationController *navController = [[UINavigationController alloc]initWithRootViewController:svc];
navController.delegate = sac;
self.slideMenuController.contentViewController = navController;
if (UIDeviceOrientationIsPortrait([[UIDevice currentDevice]orientation])) {
[self.slideMenuController hideMenu:YES];
}
}
}
shouldnt it say #import "APLSlideMenuViewController.h" ? Instead of APLSlideMenu
Hi,
I try to Upload my App to App Store, but i get the Warning on yours lib for Selectors willShowMenu and willHideMenu.
Do you can fix it warning?
Hello Tobias. Thanks so much for a very clean implementation!
I'm having an issue however. I have a couple content view controllers that are UITableViewControllers which need to have reordering ability.
It appears that APLSlideMenu's pan gesture recognizer is in the way. In other words, even though I'm setting the gestureSupport property to none, the recognizer is still added to the view and intercepts any pan gestures including when a user tries to move a cell in edit mode.
In my own code I simply exposed the dragGestureRecognizer property so I could manually add/remove it explicitly. I'm wondering if you had any thoughts on exposing that property OR adding API for the APLSlideMenu to add/remove the gesture recognizer on it's own? (probably a better solution?)
Also just fyi, the Cocoapods podspec repo is still pointing to 0.0.9.
Thanks again!
Hello!
How can I programmatically hide the left menu? This is a very important function!
I think this code crash on iOS8 when i have a NavController in the contentViewController
//- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
// // hack to trigger rotation to supported orientation in case this is not the topViewController
// if (([[navigationController viewControllers] count] < 2) || ([navigationController respondsToSelector:@selector(supportedInterfaceOrientations)] && ([navigationController supportedInterfaceOrientations] == UIInterfaceOrientationMaskAll))) return;
//
// [self presentViewController:[UIViewController new] animated:NO completion:^{
//#pragma clang diagnostic push
//#pragma clang diagnostic ignored "-Wundeclared-selector"
// if (![self respondsToSelector:@selector(leftLayoutGuide)]) {
//#pragma clang diagnostic pop
// [self dismissViewControllerAnimated:NO completion:nil];
// } else {
// dispatch_async(dispatch_get_main_queue(), ^{
// [self dismissViewControllerAnimated:NO completion:nil];
// });
// }
// }];
//}
I've tried implementing a rightMenu and it works, however when I change the menuWidth the visible frame of the RightMenu doesn't change and the additional space seems to be taken up by the leftMenu.
For example: I modified my menuWidth to (self.view.frame.size.width - 30), and although it works for LeftMenu, it isn't working for RightMenu.
When the menu is open it often overlaps the statusbar. It would be nice to hide the status bar when the menu is open.
First off, great code for the menu! Of all of the various menus in GitHuB, yours is the simplest to implement quickly.
One problem I have encountered, and maybe you could add a property to really turn off the gesture handling, but all existing "swipe" code in the "root" controller is ignored.
Pushing view controller causes crash on ios8.
I commented following bunch of code and crash disappeared.
#pragma mark - UINavigationControllerDelegate
- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
// hack to trigger rotation to supported orientation in case this is not the topViewController
if (([[navigationController viewControllers] count] < 2) || ([navigationController respondsToSelector:@selector(supportedInterfaceOrientations)] && ([navigationController supportedInterfaceOrientations] == UIInterfaceOrientationMaskAll))) return;
[self presentViewController:[UIViewController new] animated:NO completion:^{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
if (![self respondsToSelector:@selector(leftLayoutGuide)]) {
#pragma clang diagnostic pop
[self dismissViewControllerAnimated:NO completion:nil];
} else {
dispatch_async(dispatch_get_main_queue(), ^{
[self dismissViewControllerAnimated:NO completion:nil];
});
}
}];
}
But I'm not sure this is an elegant solution.
Hello! How can I disable swipe to open the menu?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.