SDCycleScrollView icon indicating copy to clipboard operation
SDCycleScrollView copied to clipboard

当图片大小不一的时候pageControlDotSize无法满足

Open Yishuhong opened this issue 4 years ago • 5 comments

Yishuhong avatar Aug 13 '20 02:08 Yishuhong

我修改了TAPageControl里面的代码,加了一个逻辑 暂时能解决问题。

  • (CGSize)dotSize { // Dot size logic depending on the source of the dot view if (self.dotImage && CGSizeEqualToSize(_dotSize, CGSizeZero)) { _dotSize = self.dotImage.size; } else if (self.dotViewClass && CGSizeEqualToSize(_dotSize, CGSizeZero)) { _dotSize = kDefaultDotSize; return _dotSize; } else if (self.currentDotImage && CGSizeEqualToSize(_dotSize, CGSizeZero)) { _dotSize = self.currentDotImage.size; }

    return _dotSize; }

qzytcl avatar Sep 18 '20 03:09 qzytcl

顺便需要修改了图片的显示方式

  • (UIView *)generateDotView { UIView *dotView;

    if (self.dotViewClass) { dotView = [[self.dotViewClass alloc] initWithFrame:CGRectMake(0, 0, self.dotSize.width, self.dotSize.height)]; if ([dotView isKindOfClass:[TAAnimatedDotView class]] && self.dotColor) { ((TAAnimatedDotView *)dotView).dotColor = self.dotColor; } } else { dotView = [[UIImageView alloc] initWithImage:self.dotImage]; dotView.contentMode = UIViewContentModeCenter; dotView.frame = CGRectMake(0, 0, self.dotSize.width, self.dotSize.height); }

    if (dotView) { [self addSubview:dotView]; [self.dots addObject:dotView]; }

    dotView.userInteractionEnabled = YES;
    return dotView; }

qzytcl avatar Sep 18 '20 03:09 qzytcl

直接修改的库代码?

HouSaiYinKay avatar Jan 04 '21 22:01 HouSaiYinKay

直接修改的库代码?

是的

qzytcl avatar Jan 13 '21 08:01 qzytcl

有同样的需求,修改了下,效果可以

image

songxing10000 avatar Jan 14 '21 03:01 songxing10000