Skip to content

yy_setImageWithURL的transform block里面修改size和圆角都不生效 #158

@rongxianyu

Description

@rongxianyu

用户头像需要调整大小和设置圆角,我用了这个方法

[self.userAvatar yy_setImageWithURL:[NSURL URLWithString:model.portrait]
                            placeholder:placeholder
                                options:YYWebImageOptionIgnoreFailedURL
                                manager:[YYWebImageManager sharedManager]
                               progress:^(NSInteger receivedSize, NSInteger expectedSize) {
        
    } transform:^UIImage * _Nullable(UIImage * _Nonnull image, NSURL * _Nonnull url) {
        image = [image yy_imageByResizeToSize:placeholder.size contentMode:UIViewContentModeCenter];
        [image yy_imageByRoundCornerRadius:5.0];
        return image;
    } completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) {

    }];

结果图片还是原来的大小,并且圆角也没有生效,是不是哪里不对?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions