wangmchn / WMPageController

An easy solution to page controllers like NetEase News
MIT License
2.92k stars 627 forks source link

menuView selected bug? #31

Closed litt1e-p closed 8 years ago

litt1e-p commented 8 years ago

it calls the method:addMenuView when I scroll , and go to below lines:

then in the WMMenuView.m: -(void)selectItemAtIndex:(NSInteger)index {

there is a delegate method @selector(menuView:didSelesctedIndex:currentIndex:), it will send to its delegate and responds to it. _animate will become NO, the bug comes:when I scroll again, the menuView couldn't add its view, cause in the method below:

it works well when I delete some delegate codes in the WMMenuView.m: - (void)selectItemAtIndex:(NSInteger)index:

// if ([self.delegate respondsToSelector:@selector(menuView:didSelesctedIndex:currentIndex:)]) { // [self.delegate menuView:self didSelesctedIndex:index currentIndex:currentIndex]; // }

is it?

wangmchn commented 8 years ago

busy this time,I will check it later. Thx a lot! =0=

wangmchn commented 8 years ago

Hey, @litt1e-p Never found this, the -slideMenuAtProgress: is call correctly. the variable _animate will become YES when scrollView start drag. In this Method, I have set it.

- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
    _animate = YES;
}

So, If still have problem,could you give me more Info or just send your demo to me? Thx a lot.

litt1e-p commented 8 years ago

ok, will email to your wangmchn@163.com

wangmchn commented 8 years ago

Hey, @litt1e-p Found the bug, it seems the bug was casued by Autolayout. I will try to fix it soon. Sorry about that.

wangmchn commented 8 years ago

still exists.....

wangmchn commented 8 years ago

Maybe fixed now.

litt1e-p commented 8 years ago

sorry, I forgot to send the demo. I will test your new fix. thanks a lot

litt1e-p commented 8 years ago

well done! you fixed this bug, it works fine in my project. wait for your pods version updating , thanks !