笔记

2017-10-30  本文已影响0人  剑锋寒

用SDWebImage加载图片时,当图片存在汉字时,加载不出来
例如:http://img001.uubaoku.com/Images/upload/photo/197066/主图/220/20170907111837551.jpg

需要将把地址转码为utf8编码 在进行加载

    NSString *str = @"http://img001.uubaoku.com/Images/upload/photo/197066/主图/220/20170907111837551.jpg";
    NSString *url = [str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
   [self.goodsImageView sd_setImageWithURL:[NSURL URLWithString:url]];
上一篇下一篇

猜你喜欢

热点阅读