ios - How can I make a transparent background for selected cells in UITableView -
how can make cells transparent. want show selected cells checkmark have done:
- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)path { uitableviewcell *cell = [tableview cellforrowatindexpath:path]; if (cell.accessorytype == uitableviewcellaccessorycheckmark) { cell.accessorytype = uitableviewcellaccessorynone; } else { cell.accessorytype = uitableviewcellaccessorycheckmark; } }
and when first create cells next line of code rid of blue background
cell.selectionstyle = uitableviewcellselectionstylenone;
but have weird issue takes 2 clicks add , remove checkboxes. maybe not right way it?
you can read making transparent uitableviewcell
s here: how create uitableviewcell transparent background
and second issue, appears perhaps want:
- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)path { uitableviewcell *cell = [tableview cellforrowatindexpath:path]; cell.accessorytype = uitableviewcellaccessorycheckmark; } - (void)tableview:(uitableview *)tableview diddeselectrowatindexpath:(nsindexpath *)path { uitableviewcell *cell = [tableview cellforrowatindexpath:path]; cell.accessorytype = uitableviewcellaccessorynone; }
Comments
Post a Comment