jsfu / JSDropDownMenu

类似美团的下拉菜单
MIT License
565 stars 138 forks source link

快速连点menu title时,会出现显示问题 #12

Open xiaobing1024 opened 7 years ago

xiaobing1024 commented 7 years ago

例子:快速连点同一个标题3次,本应该是显示列表,但是没有显示出来 解决方法:修改 animateBackGroundViewanimateLeftTableView 两个方法

···
[UIView animateWithDuration:0.2 animations:^{
    view.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.0];
} completion:^(BOOL finished) {
    if (!_show) { // 加上这个判断
        [view removeFromSuperview];
    }
}];
···
···
} completion:^(BOOL finished) {
    if (leftTableView && !_show) {// 加上这个判断
        [leftTableView removeFromSuperview];
    }
    if (rightTableView && !_show) {// 加上这个判断
         [rightTableView removeFromSuperview];
     }
 }];
···