wvp
wvp

Reputation: 1184

UITableViewCellAccessoryCheckmark not showing in iOS 7

I'm having a problem showing the Checkmark accessory in my cell. When I use something another type of accessory it works but not with the Checkmark accessory.

It works perfectly in iOS 6 but not on iOS 7. When am I missing?

 (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;
}

Upvotes: 7

Views: 6827

Answers (4)

user3928795
user3928795

Reputation:

To get the blue checkmark back (similar to iOS6), you can use:

cell.tintColor = [UIColor colorWithRed:(0.0/255.0) green:(122.0/255.0) blue:(255.0/255.0) alpha:1.0];

Upvotes: 2

jem
jem

Reputation: 63

In case this might help somebody.... for me, setting the tableview tint color did not work, but setting the cell tint color in cellForRowAtIndexPath did work:

cell.tintColor = [UIColor grayColor];

Upvotes: 3

Alvaro Rojas
Alvaro Rojas

Reputation: 562

I solved this issues changing the tint color of the uitableview

I changed the tintcolot of uitable by InterfaceBuilder to Default color

or

TableView.tintColor =  [UIColor blackColor];

Upvotes: 23

chewy
chewy

Reputation: 8267

Just as a reality check since your code seems ok can you change your [event.current boolValue] to YES , it seems the issue is actually in the value... I will also check the delegate of the tableview..

if not this or that, let us know... i will delete this answer...

if (YES) {
//..
}

Upvotes: 0

Related Questions