Open Gusont opened 5 years ago
CGFloat sinf = sin((endPercentage - startPercentage) M_PI + startPercentage M_PI 2 ) self.itemSpacing; CGFloat cosf = cos((endPercentage - startPercentage) M_PI + startPercentage M_PI 2) self.itemSpacing;
CGPoint center = CGPointMake(CGRectGetMidX(self.bounds) + sinf ,CGRectGetMidY(self.bounds) - cosf);
大意就是通过改变中心点的位置修改item的位置
CGFloat sinf = sin((endPercentage - startPercentage) M_PI + startPercentage M_PI 2 ) self.itemSpacing; CGFloat cosf = cos((endPercentage - startPercentage) M_PI + startPercentage M_PI 2) self.itemSpacing;
大意就是通过改变中心点的位置修改item的位置