uibutton设置网络图片
来源:互联网 发布:mysql数据库的安装步骤 编辑:程序博客网 时间:2024/06/05 00:50
#import <UIKit/UIKit.h>
在方法中调用:
[self xr_setButtonImageWithUrl:categoryImageArr[i] sender:typeBtn];
- (void)xr_setButtonImageWithUrl:(NSString *)urlStr sender:(UIButton *)sender {
NSURL * url = [NSURL URLWithString:urlStr];
// 根据图片的url下载图片数据
dispatch_queue_t xrQueue = dispatch_queue_create("loadImage", NULL); // 创建GCD线程队列
dispatch_async(xrQueue, ^{
// 异步下载图片
UIImage * img = [UIImage imageWithData:[NSData dataWithContentsOfURL:url]];
// 主线程刷新UI
dispatch_async(dispatch_get_main_queue(), ^{
[sender setImageViewURL:img];
});
});
}
- uibutton设置网络图片
- UIButton图片设置
- UIButton 设置图片显示contentmode
- Swift UIButton设置动态图片
- swift UIButton 设置动态图片
- UIButton 设置图片显示 contentmode
- UIButton设置图片和文字
- UIButton 获取网络图片的排版技巧
- UIBUtton需同时设置图片和文字
- iOS UIButton 设置图片不变型 setImage:
- iOS UIButton 设置图片文字垂直排列
- iOS UIButton 设置图片不变型 setImage:
- uibutton和uiimageview图片不变形设置
- UIButton设置图片不显示的问题
- UIBUtton 的两种图片设置
- UIBUtton 的两种图片设置
- iOS UIButton 设置图片文字垂直排列
- UIButton 图片文字居左居右的设置
- Hadoop处理数据(1)
- MySql(6)------SQL基础之聚合函数、分组、having子句
- HTML5之画布Canvas
- ios developer tiny share-20160818
- java synchronized详解
- uibutton设置网络图片
- cd `dirname $0`
- android studio 使用Picasso第三方库的方法
- 最小角回归(Least Angle Regression)
- php 生成数据库字典
- 天气险助阵,天气通能否突破行业变现瓶颈?
- TBS腾讯浏览服务的SDK接入
- UML统一建模语言初学
- android布局中使用include及需注意点