friend-lga / lgsidemenucontroller Goto Github PK
View Code? Open in Web Editor NEWiOS view controller which manages left and right side views
License: MIT License
iOS view controller which manages left and right side views
License: MIT License
If you replace the rootViewController after initializing the whole thing, the shadow is missing.
At first I initialize the menuController with a navigation controller, and there's a button which replaces the navigationcontroller with an other one, after I've replaced the rootViewController of the LGSideMenuController, the shadow is gone when the left or right side menu is shown.
By adding this line at Fixes this problem for left view
//line no 665
[self.view bringSubviewToFront:_rootViewCoverViewForLeftView];
.SlideAbove style is not working when used as Left view. When using it as Right view, it's working fine. All the other styles are working fine.
If you can point me in the right direction i'm also willing to offer a fix in a pull request.
Kind regards
How I can to disable visible of left/right view for some time period?
Example:
I am trying to load a tableview as my left view. Instead of showing my custom TableView class, it just shows a blank table and my table never loads. Here is my main view controller:
override func viewDidLoad() {
super.viewDidLoad()
NSNotificationCenter.defaultCenter().addObserver(self, selector: "toggleMenu", name: "toggleMenu", object: nil)
leftMenu = self.storyboard?.instantiateViewControllerWithIdentifier("LeftViewController") as! LeftMenuTableViewController
let navigationController = self.storyboard?.instantiateViewControllerWithIdentifier("NavigationController")
self.setLeftViewEnabledWithWidth(self.view.frame.width * 0.75, presentationStyle: LGSideMenuPresentationStyle.SlideBelow, alwaysVisibleOptions: LGSideMenuAlwaysVisibleOptions.OnNone)
self.rootViewController = navigationController
self.leftView().addSubview(leftMenu.tableView)
}
I've checked out the Demo's and cannot figure out what I am missing.
whenever change root view controller, status is hidden and shown after a sec which looks bad
Hi,
I have to push a new detail view controller when I tap on a tableview cell. But when I do that, the menu icon is also present on the detail view controller. But I want a back button instead of the menu icon.
Can somebody point me in the right direction?
Thank you!
Like The Picture,I Hidden NavigationBar In ViewController, So The Left PanGesture Conflict With UINavigationController.interactivePopGestureRecognizer When I PushViewController To Next ViewController , How Can Resolve It?
@Friend-LGA Could You Help Me?Thank You Very Much.
Thanks for sharing great library. Its amazing.
But I want like leftview below navigation bar.
Can you help me on this.
I integrated LGSideMenuController Removed MainViewControler added MYDashboardViewController which is added in another storyboard. two storyboard [from login] then loading LGsideMenu [DashboardViewController], every things is working perfect expect two things.
left menu do have three options (Setting, notification and profile)
When click setting how to make that as my Mainviewcontroller? Do not want to navigate to another viewcontroller.
My Dashboardviewcontorller (i.e MainViewController) viewdidload is calling three times.
Hi,
I'm really loving the customization and use of the library, but I have a problem with modal VC.
When I show a modal VC, starting from side menu or even from root (content) menu, the side menu gets corrupted graphic, and worse with every modal.
I'e tried on dispatching on main queue, but no way.
I'm attaching some images.
Any idea?
The pan gesture recognizer case UIButton can't receive UIControlEventTouchDragExit and UIControlEventTouchDragEnter event actions.
I suggest set the cancelsTouchesInView to NO. panGesture.cancelsTouchesInView = NO;
I have got this pod to work with by using UITableViewController
but for design purposes I'd like to use a UIViewController
with a navigation bar and view for status bar background. I tried duplicating my originally UITableViewController
because it worked with my "design idea" and for some reason viewDidLoad
isn't even being called anymore and self.tableView = nil
even though it is an IBO outlet
Why is that?
I added right view and it works fine with first root view controller
but when I replace it, it breaks shadow and tap gesture
I saw the closed issue which is same and the merge fixed this issue but no luck for me
any help is appreciated
The inline documentation in LGSideMenuController.h is incomplete. For example, the properties associated with these getters are undocumented.
- (UIViewController *)rootViewController;
- (UIView *)leftView;
- (UIView *)rightView;
Would you please consider documenting these properties and other members of LGSideMenuController?
Hi,
My LeftViewController is a UIViewController
with UIButton
s.
In code, I call addTarget(...)
[in Swift] for a button in LeftView, but it's not working :(
I tried with @IBOutlet
, but nothing happens.
Anyone have a example of how to get this working in swift for a Newbie?
Hi,
I have to push a detail view controller when I tap on a tableview cell using with storyboard identifier. Now i have to navigate to the designed view controller by tap table view cell in the left menu
if (indexPath.row == 0) {
ProfileViewController *profileVC = (ProfileViewController *)[mainStoryboard instantiateViewControllerWithIdentifier:"ProfileVC"];
[self.leftMenuVC navigateToViewController:profileVC];
}
- (void)navigateToViewController:(UIViewController *)viewController {
[(UINavigationController *)[self sideMenuController].rootViewController pushViewController:viewController animated:YES];
[[self sideMenuController] hideLeftViewAnimated:YES completionHandler:nil];
}
I have a tableview as my left menu. When I select a row I then switch the content of the LGSideMenuController to my new view controller and dismiss the Side menu. However, when I do that the new content loads without a status bar, then after a second loads the status bar and looks somewhat like a glitch. Any recommendations on this issue?
I currently have View Controller Based Status Bar to YES, and have tried using
override func preferredStatusBarUpdateAnimation() -> UIStatusBarAnimation { return .Fade }
in almost every view controller (including the menu view controller, the content view controllers, etc.) but still experiencing this issue.
Hi, thanks for the great side menu. Is it possible to open the side menu from a UITabBarController from the storyboard demo?
UISlider and UITableview swipe to edit was not working on any of the viewcontroller, I have UIgesturedelegate and following delegate method, what may be the reason am I missing any?
(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{
return YES;
}
It take 15~ 30 second to complete in ios 8.4 in simulator
In the Demo's you push the selected view controller from side menus. Is there a method like [self.sideMenuViewController setContentViewController:viewController animated:YES];
or should I switch it on my own? (the code is from RESideMenu)
It is not possible to close menu with swipe gesture from right menu. I guess it is because of this value "CGFloat shiftRight = 44.f;"
I suggest add menuGestureArea property or any other suggestions ?
Thanks in advance
How to hide this view In certain ViewControllers that are embedded under the same navigation controller?
When menu is opened iPad mini rotating but iPad2 devices not rotating. I check the code and find the line :
Line:1313
if (kLGSideMenuSystemVersion >= 7.0)
{
_savedStatusBarHidden = kLGSideMenuStatusBarHidden;
_savedStatusBarStyle = kLGSideMenuStatusBarStyle;
[_rootVC removeFromParentViewController];
_currentShouldAutorotate = NO;
_currentPreferredStatusBarHidden = (kLGSideMenuStatusBarHidden || !kLGSideMenuIsLeftViewStatusBarVisible);
_currentPreferredStatusBarStyle = _leftViewStatusBarStyle;
_currentPreferredStatusBarUpdateAnimation = _leftViewStatusBarUpdateAnimation;
_waitingForUpdateStatusBar = YES;
[self statusBarAppearanceUpdate];
[self setNeedsStatusBarAppearanceUpdate];
}
This is the commit : ea87888
but I don't understand why if iOS7 and above shouldn't rotate?
Thanks.
Hey, i'm getting a white screen on devices that run iOS8. The rootViewController is set but not presented.
After i'm setting the rootViewController i make my LGSideMenuController subclass a delegate of the rootViewController, this causes the view not the show
Is there any solution for this?
Thanks,
Hello.
I'm trying to change the rootViewController after touch some index in my MenuClassViewController, example:
if (indexPath.row == 2) {
NewViewController * newView = [[NewViewController alloc]init];
UINavigationController * nav = [[UINavigationController alloc]initWithRootViewController:newView];
[kMainViewController setRootViewController:newView];
}
This step it's ok, but if I try open the Menu again my application stop with this error:
Thread 1: EXC_BAD_ACCESS(code=1, address=0x10)
And showed some problem in this Method:
Do you have any idea about that?
Thank you.
Since LGSideMenuController
's [self statusBarAppearanceUpdate]
does nothing on iOS versions older than 9.0, the status bar is not animated on iOS 9.0. Two steps are needed to solve this:
- preferredStatusBarUpdateAnimation
in the side menu's root view controller(s). Here's how to do that in Swift.override func preferredStatusBarUpdateAnimation() -> UIStatusBarAnimation {
return .Slide // or return .Fade
}
LGSideMenuController
needs to be updated to perform the following animation when the menu is shown and hidden (as per this Stack Overflow answer).[UIView animateWithDuration:_leftViewAnimationSpeed animations:^{
[self setNeedsStatusBarAppearanceUpdate];
}];
Of course, any of the [UIView animateWith...
functions could be used instead.
I can get the status bar to animate when the menu appears by putting this animation block in - showLeftViewPrepare
, but I have not yet figured out how to animate the status bar when the menu disappears. If I put the animation block in - hideLeftViewDone
, then the animation (incorrectly) happens after the menu is fully hidden rather than alongside the menu hiding animation.
Any suggestions?
Steps to reproduce:
On Demo Storyboard application:
@implementation MainViewController
in MainViewController.h
- (void)viewDidLoad {
[super viewDidLoad];
UINavigationController *navigationController = [self.storyboard instantiateViewControllerWithIdentifier:@"NavigationController"];
self.rootViewController = navigationController;
[self setupWithPresentationStyle:LGSideMenuPresentationStyleSlideAbove type:0];
}
setupWithPresentationStyle:LGSideMenuPresentationStyleSlideBelow
also doesn't work.
Can you provide information about how to start a SideViewController directly from storyboard?
I have a issues with LGSideMenuPresentationStyleSlideAbove.
I can use other styles but not this. After click menu button, my main view is dimmed, but i don't see left menu.
Sorry for my bad english, can you help me?
My view controller where I want to use kMainViewController is not the root controller. My view controller is located in a tabbarcontroller as root controller and then as subview of a navigation controller . How do I have to change the #define below to make it work?
Thanks in advance Michael
This looks like an awesome and more simplified version of other navigation drawer libraries. I was wondering if you could provide an example using storyboards, since thats a pretty common way for setting up view hierarchies these days.
Thanks!
I have a static table view and when I touch any row suddenly the table disappears (rows disappear but background image remains)
Here is my code:
@property (strong, nonatomic) MenuTableViewController *menuView;
and initilizing the navigation controller
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
UINavigationController *navigationController = [storyboard instantiateViewControllerWithIdentifier:@"NavigationView"];
LGSideMenuController* sideMenuController = [[LGSideMenuController alloc] initWithRootViewController:navigationController];
[sideMenuController setRightViewEnabledWithWidth:self.view.frame.size.width
presentationStyle:LGSideMenuPresentationStyleSlideAbove
alwaysVisibleOptions:LGSideMenuAlwaysVisibleOnNone];
sideMenuController.rightViewStatusBarStyle = UIStatusBarStyleDefault;
_menuView = [self.storyboard instantiateViewControllerWithIdentifier:@"TableView"];
[sideMenuController.rightView addSubview:_menuView.tableView];
UIWindow *window = [UIApplication sharedApplication].delegate.window;
window.rootViewController = sideMenuController;
[UIView transitionWithView:window
duration:0.3
options:UIViewAnimationOptionTransitionCrossDissolve
animations:nil
completion:nil];
and the table view code ๐
- (void)viewDidLoad {
[super viewDidLoad];
[self.tableView setBackgroundColor:[UIColor clearColor]];
UIImageView *tableBackgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"img_menu.jpg"]];
tableBackgroundView.contentMode = UIViewContentModeScaleAspectFill;
[tableBackgroundView setFrame: self.tableView.frame];
[self.tableView setBackgroundView:tableBackgroundView];
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 8;
}
Also I should say my side menu is full screen.
Another problem is I can't handle touch events of buttons inside the table view. Nether dynamic tables with programmatically handled actions nor referenced IBAction
from storyboard.
Hello!
May you please describe how to disable open-menu-gesture on separate view keeping open-menu-gesture working on other views?
Thanx in advance.
i have clean project it have only one view,
so i need example how to use LGSideMenuController in clean project please help
if, my pleasure. A picture is worth a thousand words.
https://www.dropbox.com/sh/kcvuimjukhpst99/AAA7lIgU-xS-BptQRzgxkg8_a?dl=0
such as : when i want to show leftcontroller ,viewwillappear in leftviewcontroller can't trigger!!!
When I use :
sideMenuController.leftView().addSubview(menuController.view)
my code works fine but when I use :
sideMenuController.rightView().addSubview(menuController.view)
my app crash and I get this error :
fatal error: unexpectedly found nil while unwrapping an Optional value
Hello, I'm using the last version and when I scroll my menu it disappear (the tableview cell became empty). I'm using static tableview and the menu works fine with MMDrawerController.
(before big image) (after scrolling the small image)
This issue may have relation with this one : #18
Hi,
After setting the backgroundimage the tableview isn't visible anymore.. If I remove the backgroundimage I can see it, but when I set the backgroundimage I only see the image..
I've tried adding it after adding the tableview as a subview, before etc etc. nothing...
Any idea what that can be?
(it's in Swift)
var rootvc = self.storyboard?.instantiateViewControllerWithIdentifier("ViewController") as! ViewController;
rightMenu = self.storyboard?.instantiateViewControllerWithIdentifier("RightViewController") as! RightViewController;
self.setRootViewController(rootvc);
self.rightViewBackgroundImage = UIImage(named: "ocean");
self.setRightViewEnabledWithWidth(100.0, presentationStyle: LGSideMenuPresentationStyleScaleFromBig, alwaysVisibleOptions: LGSideMenuAlwaysVisibleOnNone);
//self.rightViewBackgroundImage = UIImage(named: "ocean.jpg");
rightMenu.tableView.reloadData();
rightMenu.tableView.backgroundColor = UIColor.clearColor();
var rightView = self.rightView();
rightView.addSubview(rightMenu.tableView)
rootvc.main = self;
i added right and left views in view controller@1 now i want to add in 3rd view controller but not root to window how can i do right view above on third view
Is this project still going to be maintained or not? I see quite a few PRs and Issues not being handled. /cc @Friend-LGA
Guys, sorry, but now I totally don't have enough time to support my repositories. If somebody want to participate I will glad to add him.
And one more thing. If you really want to collaborate, prove your interesting in this library. Star it, fork it, make some issues, pull request. Show me that you understand how it works inside. Or if you do not create any pull request, but really want to improve this library, show me some your ios code and let me see your level.
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.