この記事について
| 環境 | Xcode、Objective-C |
|---|---|
| 目的 | セルを選択してもハイライトさせない |
| 結果 | cellForRowAtIndexPath内で cell.selectionStyle = UITableViewCellSelectionStyleNone; を設定する |
Xcode でセルを選択してもハイライトにしない記述
//Objective-C での書き方
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell3" forIndexPath:indexPath];
//ここ
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
