Minhao Dong
Minhao Dong

Reputation: 17

UITableView checkmark has a white background

I customised tableview cell style with an imageview filling the entire cell. A checkmark is displayed when an UIAlertAction is called. But it displays a white box around the checkmark.

The background image shrinks when checkmark is displayed:

1

and without the checkmark:

2

I have tried:

let color = cell.contentView.backgroundColor cell.backgroundColor = color

in the tableview(cellforrowatindexpath) but it doesn't work.

How do I remove this white accessoryview?

Upvotes: 1

Views: 344

Answers (2)

Maulik Rajani
Maulik Rajani

Reputation: 639

Instead of accessoryview you can use imageview to show Checked record.

Upvotes: 4

Özgür Ersil
Özgür Ersil

Reputation: 7013

try to avoid editing with the override code

func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
        // the cells you would like the actions to appear needs to be editable
        return false
    }

Upvotes: 1

Related Questions