ios 中请求主线程刷新UI
2016-04-01 11:43
330 查看
if ([NSThread isMainThread]) { [self.downloadMapBtn setImage:[UIImage imageNamed:@"download_map.png"] forState:UIControlStateNormal]; [self.downloadMapBtn setNeedsDisplay]; } else { dispatch_sync(dispatch_get_main_queue(), ^{ //Update UI in UI thread here [self.downloadMapBtn setImage:[UIImage imageNamed:@"download_map.png"] forState:UIControlStateNormal]; [self.downloadMapBtn setNeedsDisplay]; }); }
相关文章推荐
- String,StringBuffer, StringBuilder 的区别是什么?
- 图形用户界面(GUI)
- 图形用户界面(GUI)
- afnetwork 又一个坑“The request timed out”
- EasyUi combotree 实现动态加载树节点
- php require和include区别
- UITableview性能优化总结
- datatables(1.10.10+)+模块化请求(require.js or others)
- EasyUi中的Combogrid 实现分页和动态搜索远程数据
- currval of sequence "follow_id_seq" is not yet defined in this session
- UIAlertController 使用
- 在ofbiz框架里面对request里面的值处理
- 简介EasyUI datagrid editor combogrid搜索框的实现
- 分析可变形字符串序列StringBuilder 以及 StringBuffer之默认大小与扩容
- 阻塞队列--LinkedBlockingQueue
- 阻塞队列BlockingQueue用法
- @PathParam 和 @QueryParam
- ServletAPI --- Request接口
- 封装OpenGL渲染为DLL,C#做UI显示
- UIPresentationController自定义转场动画