12207480 / DOPDropDownMenu-Enhanced

DOPDropDownMenu 添加双列表 优化版 新增图片支持(double tableView, The optimization version ,new add image,detailText)
MIT License
1.74k stars 362 forks source link

sometimes the menu column title doesn't get updated #3

Closed yao2030 closed 8 years ago

yao2030 commented 9 years ago

I almost spent a whole morning found out the solution to this problem, just add ceil(size.width), everything works well.

- (void)animateTitle:(CATextLayer *)title show:(BOOL)show complete:(void(^)())complete {
    CGSize size = [self calculateTitleSizeWithString:title.string];
    CGFloat sizeWidth = (size.width < (self.frame.size.width / _numOfMenu) - 25) ? size.width : self.frame.size.width / _numOfMenu - 25;
    title.bounds = CGRectMake(0, 0, ceil(sizeWidth), size.height);
    if (!show) {
        title.foregroundColor = _textColor.CGColor;
    } else {
        title.foregroundColor = _textSelectedColor.CGColor;
    }
    complete();
}
12207480 commented 9 years ago

thank you