UIImageJPEGRepresentation 問題
UIImageJPEGRepresentation會導致透明底變為白底
UIImagePNGRepresentation替換
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:item.iconUrl]];
[imageView setImageWithURLRequest:request placeholderImage:nil success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
NSData *data = UIImagePNGRepresentation(image);
[FileManager saveCacheImgWith:data imgName:[NSString stringWithFormat:@"%ld",(long)item.itemId] path:[FileManager getDeviceIconExaplePath] fileExtension:@"png"];
NSLog(@"下載成功 %@", item.itemName);
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error) {
NSLog(@"下載失敗 %@", item.itemName);
}];
相關文章
- 發現問題,解決問題
- 解決「問題」,不要解決問題
- WebService 訪問問題Web
- 提問題比解決問題更重要
- 一個非技術問題的問題
- MySQL 問題MySql
- 【Git】問題Git
- JS問題JS
- pycharm問題PyCharm
- beego問題Go
- 字串問題字串
- php問題PHP
- goto問題Go
- java 問題Java
- 問題思考
- 面試問題面試
- TestSendMail問題AI
- JdonFramework問題!Framework
- castor問題AST
- index問題Index
- 429問題
- ABA 問題
- 問問題之前 先GoogleGo
- 問個Javascript replace 問題JavaScript
- 轉賬問題是屬於業務問題還是屬於技術問題?
- 面試題:階乘問題面試題
- [開發問題]React-native問題集React
- 【問題記錄】—.NetCore 編譯問題NetCore編譯
- 【問題解決】單機搭建dataguard的問題
- [提問交流]URL地址問題,,
- 前端面試常問問題前端面試
- 專案中常問的問題
- jvm常問問題目錄JVM
- Oracle常見問題一千問Oracle
- 面試、筆試提問問題面試筆試
- 問個菜鳥-高手問題
- 測試CMS同步問題測試CMS同步問題
- 【問題追查】mc叢集寫入恍惚問題排查