如何使UIProgressView对UITableViewCell的更改立即? [英] how to make UIProgressView on the UITableViewCell change immediately?
本文介绍了如何使UIProgressView对UITableViewCell的更改立即?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在UITableViewCell上放置一个UIProgressView,例如:
I put a UIProgressView on a UITableViewCell, like that:
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"downloadcell"];
if(cell==nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:@"downloadcell"] autorelease];
UIProgressView* downPreView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault];
downPreView.tag = 123;
downPreView.frame = CGRectMake(400,70, 200,10);
[cell.contentView addSubview:downPreView];
}
当下载大小改变时,我这样做:
When download size have changed, I do that:
UIProgressView* downPreView = (UIProgressView*)[cell viewWithTag:123];
downPreView.progress = downloadPre;
但是downPreView的外观不会立即改变,只有在我触摸单元格或其他单元格,让UIProgressView对UITableViewCell立即改变?
but the look of downPreView will not change immediately, only after I touch cell or other cell, so how to make UIProgressView on the UITableViewCell change immediately?
推荐答案
performSelectorOnMainThread就可以了。一切就好了。
performSelectorOnMainThread on it and everything is fine.
这篇关于如何使UIProgressView对UITableViewCell的更改立即?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文