andreamazz / SlideOutNavigation

SlideOut Navigation Controller for iOS.
MIT License
210 stars 49 forks source link

Table won't scroll past certain point #60

Closed drallgood closed 10 years ago

drallgood commented 10 years ago

For testing purposes, I've added 30 elements to the first section (which is usually filled with the users data => might vary in size) and 2 to a second one.

Now I can't scroll all the way down to the second section.

Any idea why this is happening?

andreamazz commented 10 years ago

Hi @drallgood I added about 40 elements to the first and second section each of the sample project, and the table scrolls just fine. Did you customize the control in any way?

drallgood commented 10 years ago

I'm using these options:

 AMOptionsEnableShadow : @(YES),
 AMOptionsUseBorderedButton : @(borderedButton),
 AMOptionsEnableGesture: @(NO),
 AMOptionsBackground: backgroundColor,
 AMOptionsSelectionBackground: [UIColor colorWithRed:.298 green:.572 blue:.815 alpha:1.0f],
 AMOptionsHeaderFont: [UIFont fontWithName:@"AovelSans-Bold" size:20],
 AMOptionsHeaderFontColor : [UIColor whiteColor],
 AMOptionsCellFont : [UIFont fontWithName:@"AovelSans" size:18],
 AMOptionsCellFontColor: [UIColor whiteColor],
 AMOptionsCellBackground: backgroundColor,
 AMOptionsCellBadgeFont : [UIFont fontWithName:@"AovelSans" size:15],
 AMOptionsHeaderFont : [UIFont systemFontOfSize:14]

The menu items are added to the controller via the setMenuItems: method. Each menu item is added to the menuItems array with the following code:

    NSMutableDictionary* item = [[NSMutableDictionary alloc] init];
    item[kSOController] = controller;
    item[kSOViewTitle] = controller.roomName;
    item[kSOViewIcon] = @"";

    item[kSOViewTag] = @(controller.roomNumber);
    [menuItems[0][kSOSection] addObject:item];
andreamazz commented 10 years ago

Hi I tried with your options, and still can't reproduce the issue. Can you reproduce it in the sample project?

drallgood commented 10 years ago

To be honest: No. I can't either. Just tried it and it worked just fine... which is weird because I don't think I did anything special.

I copied all the code that has to do with SlideOutNavigation to the sample app delegate and even tried to reproduce the delayed (asynchronous) update of the list.

Any idea how to find out what's going on?

drallgood commented 10 years ago

I managed to reproduce it after all! It's working fine on the iPhone but not on the iPad.

Here's the project: https://dl.dropboxusercontent.com/u/17133427/SlideOutSample.zip

andreamazz commented 10 years ago

Huh, funny thing is, in portrait orientation it works fine. So I guess the culprit is the orientation handling. I'll look into it.

andreamazz commented 10 years ago

Commit 39741e8 should fix the issue.

drallgood commented 10 years ago

Now it's completely broken ;)

ios simulator screen shot jan 27 2014 1 19 07 am

andreamazz commented 10 years ago

Now that's fun. Removing the code that I added yesterday, the issue persists. It's probably due to the last pull request that I merged, which added quite a bit of code. I have to figure out what's causing this. I'll keep you posted.

drallgood commented 10 years ago

Haha... Yeah. I figured that out, too. I'll dig around a little bit, too, and let you know when I find something that might help.

andreamazz commented 10 years ago

Ok, found the culprit.

    if([dict[kSOViewTag] integerValue] == self.currentTag) {
        [self hideSideMenu];
        return;
    }

You need to use tags (greater than 0) or the first call to the VC selector will do nothing. I'll push a new version later, I guess I'll just remove those lines, since they break compatibility pretty bad.

andreamazz commented 10 years ago

Checkout commit e598aa4

drallgood commented 10 years ago

hmm.. That didn't do it. It's still not showing the first controller

drallgood commented 10 years ago

Sorry. My bad. It did fix it. Somehow I just thought I had pulled your changes and apparently I didn't.

Thanks for your time!!!

andreamazz commented 10 years ago

Glad I could help. :beer: