セルを選択するとUITableViewCellサブビューが消える
私は、ユーザーがたとえば10色(製品によって異なります)から選択できる色選択テーブルビューを実装しています。ユーザーは他のオプション(ハードドライブ容量など)を選択することもできます。 すべての色オプションは、独自のテーブルビューセクション内にあります。 実際の色を示すtextLabelの左側に小さな正方形を表示したいと思います。 今、私は単純な正方形のUIViewを追加し、それに次のような正しい背景色を与えます: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:RMProductAttributesCellID]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:RMProductAttributesCellID] autorelease]; cell.indentationWidth = 44 - 8; UIView *colorThumb = [[[UIView alloc] initWithFrame:CGRectMake(8, 8, 28, 28)] autorelease]; colorThumb.tag = RMProductAttributesCellColorThumbTag; colorThumb.hidden = YES; [cell.contentView …