how to make UIProgressView on the UITableViewCell change immediately?

匿名 (未验证) 提交于 2019-12-03 02:56:01

问题:

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;

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?

回答1:

performSelectorOnMainThread on it and everything is fine.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!