作者mike20029631 (mike)
看板MacDev
标题[问题] tableHeaderView使用GCD载图
时间Tue May 12 23:05:48 2015
tableview上的tableHeaderView使用PagePhotosView传回来的图(透过网路载的图)
确定已经return回来了,但却迟迟不显示,都要过大约四五秒才会显示
若先跳至其它页马上按回此页,就会马上看到刚刚载的图,所以确定其实已经return回来
只是很慢才显示!
有办法得知它显示的确切时间点吗
或在它显示前是否会再去多执行哪些程式导致显示缓慢?
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
pagePhotosView = [[PagePhotosView alloc] initWithFrame:
CGRectMake(0,0,320,180)];
dispatch_async(dispatch_get_main_queue(), ^{
tableView.tableHeaderView=pagePhotosView;
});
});
以上,麻烦各位帮帮忙~ 感谢!OB
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 114.26.132.41
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/MacDev/M.1431443151.A.4D9.html
1F:推 appleway: try to create pagePhotosView in main thread 05/13 06:33
2F:→ wcha: 你怎麽确定图已经载回来了?程式码只有看到你把 05/14 13:42
3F:→ wcha: pagePhotosView 建好後,用 main thread 塞给 headerView 05/14 13:43