nverinaud / NVSlideMenuController

A slide menu done right for iOS.
MIT License
175 stars 33 forks source link

Fix bug with force menu reframing #25

Closed bimawa closed 10 years ago

bimawa commented 10 years ago

If in menuController i set specific frame for it, openMenuAnimated, and others, methods reframed my view.

nverinaud commented 10 years ago

I don't understand your use case. You don't want the menuViewController'sview to be 100% slideMenuController'sview height and specified menuWidth width ?

bimawa commented 10 years ago

Yes, but it trouble in iOS7. If i initialize mainViewController with custom frame, for example y:20 for give space for status bar, and after menuViewFrameAccordingToCurrentSlideDirection it reframe my origin.y in mainViewController. :(

nverinaud commented 10 years ago

You shall not reframe your mainViewController's view to handle the status bar frame in iOS 7. Instead I suggest you to reframe its subviews. Your view controllers are not supposed to update their view's frame, it is the responsibility of the container view controller.

bimawa commented 10 years ago

Ok thx a lot for comment.

bimawa commented 10 years ago

@nverinaud i need help a bit. in code below i make init NVSlideMenuController and GFMainMenuViewController is UITableViewController it has tableView(some self.view) in up level.

GFMainViewController *mainViewController = [GFMainViewController new];
GFMainMenuViewController *menuViewController = [GFMainMenuViewController new];
NVSlideMenuController *nvSlideMenuController = [[NVSlideMenuController alloc] initWithMenuViewController:menuViewController andContentViewController:mainViewController];
[nvSlideMenuController setMenuWidth:260];

in menuViewController i need move tableView in subview?

nverinaud commented 10 years ago

I would suggest to do a normal UIViewController subclass with a UITableView subview.

bimawa commented 10 years ago

I think this is not the right solution? looks like the stub...

nverinaud commented 10 years ago

Hum…you could also try to tweak UIViewController's edgesForExtendedLayout and extendedLayoutIncludesOpaqueBars so that the status bar does not overlap your table view.

bimawa commented 10 years ago

i try it too. its not working, becouse in iOS 7 starting pont for x,y its left-top edge under statusBar.

nverinaud commented 10 years ago

Ok, the right way is to make GFMainMenuViewController be a subclass of UIViewController and add an UITableView as an outlet and subview.

bimawa commented 10 years ago

Ok i understand you. Thx a lot for help. I will do as you advise.