0

iOS 怎样显示Base64编码后的图片

jk created at5 years ago view count: 2789
report
回复
0
NSURL *url = [NSURL URLWithString:base64String];    
NSData *imageData = [NSData dataWithContentsOfURL:url];
UIImage *ret = [UIImage imageWithData:imageData];

base64 encode 后的字符串前面需要加上data:image/png;base64,
5 years ago 回复