笔记

作者: 剑锋寒 | 来源:发表于2017-10-30 17:08 被阅读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]];

相关文章

网友评论

      本文标题:笔记

      本文链接:https://www.haomeiwen.com/subject/zocmpxtx.html