カスタムを作成し、その他のクラスでtableView
カスタムtableView
クラスを使用してtableView
..
サーバーから画像を読み込んで表示していtableViewRow
ます..それぞれimage
が異なります..
画面には10枚の画像のうち7枚しか表示されず、下にスクロールすると最初の3枚の画像がしばらく繰り返され、それらの画像が読み込まれると適切な画像が表示されます..しかし、最初は新しい画像が表示されるまで古い画像が表示されます。古い画像の代わりに画像が読み込まれていることを示すアクティビティ インジケーターを配置したい..
get load..まで、activity Indicator
の代わりに追加したい。image
image
私のコードは...
self.tableViewX = tableView;
static NSString *simpleTableIdentifier = @"SimpleTableCell";
SimpleTableCell *cell = (SimpleTableCell *)[tableView1 dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"SimpleTableCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^
{
NSString *imageURL = [NSString stringWithFormat: @"www.xyz.image.png"];
cell.thumbnailImageView.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:imageURL]]];
});
いくつかのサンプルコードで私を助けてください..