- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{
// セルを取得する
ItemCell* cell;
cell = (ItemCell*)[self._itemTable dequeueReusableCellWithIdentifier:@"ItemCell"];
if (!cell) {
cell = [[ItemCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"ItemCell"];
// ハイライトなし
cell.selectionStyle = UITableViewCellSelectionStyleNone;
[cell autorelease];
}
}
- (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath
{
// ハイライトの解除 (このコードがない場合、Background colerが白だとタッチされたときに文字が見えなくなる。)
[self._itemTable deselectRowAtIndexPath:indexPath animated:YES];
}
■参考記事
http://d.hatena.ne.jp/glass-_-onion/20090324/1237864499
タグ:iPhone