Closed yao2030 closed 8 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(); }
thank you
I almost spent a whole morning found out the solution to this problem, just add ceil(size.width), everything works well.