以下のようなすべてのテーブルビューセルに循環カスタム進行状況ビューを追加します。すべてのテーブルビューセルから進行状況ビューを削除します
cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
// progressView = (M13ProgressViewPie *)[cell viewWithTag:100];
progressView = [[M13ProgressViewPie alloc] initWithFrame:CGRectMake(0.0, 0.0, 50.0, 5.0)];
progressView.tag = indexPath.row;
NSLog(@"%ld",(long)progressView.tag);
// Configure the progress view here.
[progressView setAnimationDuration:10.0];
// Add it to the view.
[cell.contentView addSubview: progressView];
// Update the progress as needed
[progressView setProgress: 1.0 animated: YES];
私は10秒
[NSTimer scheduledTimerWithTimeInterval:10.0 target:self selector:@selector(updateUI) userInfo:nil repeats:YES];
のnstimer後、円形の進捗状況をリロードしたいとのupdateUI方法で私は、セルのコンテンツビューのサブビューを削除しています。
これで、最後のセルの進行状況を再読み込みすることしかできませんでした。それはすべての細胞に適用されていません。 viewDidLoad
- (void)updateUI {
isProgressRemove = yes;
[self.tableView reload];
isProgressRemove = NO;
}
いくつかのコードを共有します。更新UIメソッドの – KKRocks
:NSArray * subviews = [cell.contentView subviews]; (サブビューのM13ProgressView *サブビュー){ [subview removeFromSuperview]; } –
ここで、開始タイマーは何ですか?中に追加? – KKRocks