Note that there are some explanatory texts on larger screens.

plurals
  1. POUITableViewCell highlight covers my accessoryView
    primarykey
    data
    text
    <p>I have a checkbox, when its checked, it gets checkmarked. But when i select the cell, the highlight covers up the checkbox. Sorry for my horrible english, but here is the code below. Is there a way for me to have the checkmark button on top of the highlight?</p> <pre><code>-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCell *cell = nil; if([tableView isEqual:self.myTableView]){ static NSString *TableViewIdentifier = @"MyCells"; cell = [tableView dequeueReusableCellWithIdentifier:TableViewIdentifier]; if(cell == nil){ cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:TableViewIdentifier]; } //configure the cell checkbox = [UIButton buttonWithType:UIButtonTypeCustom]; CGRect checkboxRect = CGRectMake(135, 150, 36, 36); [checkbox setFrame:checkboxRect]; [checkbox setImage:[UIImage imageNamed:@"unselected@2x.png"]forState:UIControlStateNormal]; [checkbox setImage:[UIImage imageNamed:@"selected@2x.png"] forState:UIControlStateSelected]; [checkbox addTarget:self action:@selector(checkboxClicked:) forControlEvents:UIControlEventTouchUpInside]; cell.accessoryView = checkbox; NSString *group; NSUInteger row = [indexPath row]; switch (indexPath.section) { case 0: group = [suggestedPeople objectAtIndex:row]; cell.textLabel.text = group; break; case 1: group = [aArray objectAtIndex:row]; cell.textLabel.text = group; break; case 2: group = [bArray objectAtIndex:row]; cell.textLabel.text = group; break; case 3: group = [cArray objectAtIndex:row]; cell.textLabel.text = group; break; case 4: group = [dArray objectAtIndex:row]; cell.textLabel.text = group; break; case 5: group = [eArray objectAtIndex:row]; cell.textLabel.text = group; break; case 6: group = [fArray objectAtIndex:row]; cell.textLabel.text = group; break; case 7: group = [gArray objectAtIndex:row]; cell.textLabel.text = group; break; case 8: group = [hArray objectAtIndex:row]; cell.textLabel.text = group; break; case 9: group = [iArray objectAtIndex:row]; cell.textLabel.text = group; break; case 10: group = [jArray objectAtIndex:row]; cell.textLabel.text = group; break; case 11: group = [kArray objectAtIndex:row]; cell.textLabel.text = group; break; case 12: group = [lArray objectAtIndex:row]; cell.textLabel.text = group; break; } } return cell;} </code></pre> <p>and some of my other methods:</p> <pre><code>-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; NSLog(@"cell is touched"); if(checkbox.state == UIControlStateNormal){ [checkbox setImage:[UIImage imageNamed:@"unselected@2x.png"] forState:UIControlStateHighlighted]; }else if (checkbox.state == UIControlStateSelected) { [checkbox setImage:[UIImage imageNamed:@"selected@2x.png"] forState:UIControlStateHighlighted]; }} -(void)checkboxClicked:(UIButton *)sender{ sender.selected = !sender.selected; UITableViewCell *ownerCell = (UITableViewCell *)sender.superview; NSIndexPath *ownerCellIndexPath = [self.myTableView indexPathForCell:ownerCell]; if(sender.selected){ }else{ }} </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload