Note that there are some explanatory texts on larger screens.

plurals
  1. POUITableView can not show correct color of button in iOS
    primarykey
    data
    text
    <p>I used <strong>BVReorderTableView</strong> <a href="https://github.com/bvogelzang/BVReorderTableView" rel="nofollow">https://github.com/bvogelzang/BVReorderTableView</a> to reorder row in tableview. But i have a problem: When I add UIButton to each row, this button always show clear color.Once selected row, this button just shown. </p> <p>I tried this code:</p> <pre><code> - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell; cell = [_tableView dequeueReusableCellWithIdentifier:CellIdentifier]; UIButton *prioritybtn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; [prioritybtn setFrame:CGRectMake(220, 0, 70, 32)]; [prioritybtn setTag:4000]; [cell.contentView addSubview:prioritybtn]; } UIButton *priorityButton = (UIButton*)[cell.contentView viewWithTag:4000]; if ([[items objectAtIndex:indexPath.row] isKindOfClass:[NSString class]] &amp;&amp; [[items objectAtIndex:indexPath.row] isEqualToString:@"DUMMY"]) { cell.textLabel.text = @""; cell.contentView.backgroundColor = [UIColor clearColor]; prioritybtn.hidden= YES; } else { cell.textLabel.text = [items objectAtIndex:indexPath.row]; [priorityButton setSelected:NO]; [priorityButton setTitle:@"Priority" forState:UIControlStateNormal]; priorityButton.enabled = YES; } return cell; } </code></pre> <p>Also, I want to hide button only at first row, other row is still shown. How can i do that? Thanks</p>
    singulars
    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.
    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