if (_datasourceImages.count == 0) {
if ([self.datasource respondsToSelector:@selector(placeHolderImageOfZeroBannerView)]) {
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(_scrollView.frame), CGRectGetHeight(_scrollView.frame))];
imageView.contentMode = UIViewContentModeScaleAspectFill;
// Add
imageView.layer.masksToBounds = YES;
imageView.backgroundColor = [UIColor clearColor];
imageView.image = [self.datasource placeHolderImageOfZeroBannerView];
[_scrollView addSubview:imageView];
}
return;
}
Add
for (NSInteger i = 0; i < _datasourceImages.count; i++) {
CGRect imgRect = CGRectMake(contentWidth * i, 0, contentWidth, contentHeight);
UIImageView *imageView = [[UIImageView alloc] initWithFrame:imgRect];
imageView.backgroundColor = [UIColor clearColor];
// Add
imageView.layer.masksToBounds = YES;
imageView.contentMode = [_datasource contentModeForImageIndex:i];
Hope to be able to change to update your files.
if (_datasourceImages.count == 0) {
if ([self.datasource respondsToSelector:@selector(placeHolderImageOfZeroBannerView)]) {
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(_scrollView.frame), CGRectGetHeight(_scrollView.frame))];
imageView.contentMode = UIViewContentModeScaleAspectFill;
// Add
imageView.layer.masksToBounds = YES;
imageView.backgroundColor = [UIColor clearColor];
imageView.image = [self.datasource placeHolderImageOfZeroBannerView];
[_scrollView addSubview:imageView];
}
return;
}
Add
for (NSInteger i = 0; i < _datasourceImages.count; i++) {
CGRect imgRect = CGRectMake(contentWidth * i, 0, contentWidth, contentHeight);
UIImageView *imageView = [[UIImageView alloc] initWithFrame:imgRect];
imageView.backgroundColor = [UIColor clearColor];
// Add
imageView.layer.masksToBounds = YES;
imageView.contentMode = [_datasource contentModeForImageIndex:i];
Hope to be able to change to update your files.