我在UITableViewCell上放置了UIProgressView,如下所示:
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];
}
当下载大小改变时,我会这样做:
UIProgressView* downPreView = (UIProgressView*)[cell viewWithTag:123];
downPreView.progress = downloadPre;