7

セルにチェックマーク アクセサリを表示する際に問題が発生しています。別の種類のアクセサリを使用すると機能しますが、Checkmark アクセサリでは機能しません。

iOS 6 では完全に動作しますが、iOS 7 では動作しません。

 (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:EVENT_SELECTION_CELL_IDENTIFIER forIndexPath:indexPath];
    Event *event = [self.fetchedResultsController objectAtIndexPath:indexPath];
    cell.textLabel.text = event.name;
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    if ([event.current boolValue]) {
        cell.accessoryType = UITableViewCellAccessoryCheckmark;
    } else {
        cell.accessoryType = UITableViewCellAccessoryNone;
    }
    return cell;
}
4

4 に答える 4

23

uitableviewの色合いを変更してこの問題を解決しました

InterfaceBuilder で uitable の tintcolot を Default color に変更しました

また

TableView.tintColor =  [UIColor blackColor];
于 2013-10-14T19:24:06.123 に答える
3

これが誰かを助けるかもしれない場合に備えて....私にとっては、テーブルビューの色合いの設定は機能しませんでしたが、cellForRowAtIndexPathでセルの色合いの設定は機能しました:

cell.tintColor = [UIColor grayColor];
于 2014-05-06T18:03:17.233 に答える
2

青色のチェックマークを戻すには (iOS6 と同様)、次を使用できます。

cell.tintColor = [UIColor colorWithRed:(0.0/255.0) green:(122.0/255.0) blue:(255.0/255.0) alpha:1.0];
于 2014-08-18T10:16:11.213 に答える