【Xcode】TableViewでセルを選択してもハイライトにしない方法

この記事について

環境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;

}
タイトルとURLをコピーしました