Closed daljeet16 closed 9 years ago
Unfortunately you can't use UIViewController as menu in this version of AMSlideMenu. But you can achieve that with UITableViewController too. E.g. you can set tableview style to group, and use section header's view.
Or, If you look at this: link, you can see a little hack (in -setFixedStatusBar
method) that I made in UITableViewController. This partly makes UITableViewController like UIViewController.
Just replace statusBarView
with your static header view :)
Hi Artur
I have implemented as same as you suggested with viewForHeaderInSection and its working fine. Thanks a lot for the same.
I'm facing another issue now while implementing this, I hope you can help in the same.
I'm using AMSlideMenu with storyboards and implemented with tab bar viewController, but now the slider button is not appearing in the navigation bar. This is the code in MainVC.m :-
I have tried putting breakpoint in the above code and the code executes, but the button does not appear. Look forward to your help.
Thanks so much !
Can you make a demo project and send it to me via email (mkrtarturdev@gmail.com) ? I can't say anything without looking what have you done :)
@daljeet16 even i want to setup this type of layout on left menu.... how did u solve can u plz share the code of it??
@hardikamal here is the code.
(UIView ) tableView:(UITableView )tableView viewForHeaderInSection:(NSInteger)section {
UIImageView *userImage=[[UIImageView alloc] initWithFrame:CGRectMake(15, 30, 80, 80)];
UIView *sectionHeader = [[UIView alloc] init]; sectionHeader.backgroundColor = [UIColor colorWithRed:85.0/255.0 green:139.0/255.0 blue:47.0/255.0 alpha:1.0]; [sectionHeader addSubview:userImage]; return sectionHeader; }
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ return 170.0f; }
@daljeet16 where do i place this code....and what is this variable userName that is giving some error plz help
You have to put in AMSlideMenuLeftTableViewController class I updated the comment it is userImage not userName.
Hi Artur
@arturdev I created a sample project with storyboard and tabBar, in that everything is working fine the button appear in navBar but when I did the same thing in my app project the slider button is not coming.
I can't share my whole project with you is there any other way to solve this issue.
@daljeet16 Solved thanks bro
Actually it isn't good practice to make changes in the Library.
I strongly recommend you to make a subclass from AMSlideMenuLeftTableViewController
and do your customizations there.
@arturdev yeah did that only...Thanks for the suggestion and awesome library
@arturdev This is my storyboard structure,hope it give some clarity to you
Hmm. Try [self addLeftMenuButton]
in that view controller. And don't forget to import "UIViewController+AMSlideMenu.h"
@hardikamal You're welcome! :)
@arturdev its working thanks!
@daljeet16 You're welcome!
I am using this library in my app for side menu and is working fine as such, but but I have a specific requirement which I am unable to achieve with the current version.
When I add a view in UITableViewController, then the complete view is scrolling which I don't want.That is why I tried to add UIViewController containing a tableview which has a view as a subview of UIViewController. But in this case, AMSlideMenu stops working.
This functionality is absolutely similar to the attached screenshot from google maps app, which has the top part as static and the list is scrollable.
Is there any solution to meet this design requirement ? ( in a new release probably ) Help is appreciated, thanks!