Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You should create a <code>UITableViewCell</code> whose <code>contentView</code> holds 3 separate <code>UIButtons</code>. To do this programmatically, in your <code>tableView:cellForRowAtIndexPath:</code> data source method, you can use code similar to the following:</p> <pre><code>- (UITableViewCell*) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString* identifier = @"cell"; UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:identifier]; if (!cell) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil]; cell.backgroundColor = [UIColor clearColor]; UIButton* button1 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; UIButton* button2 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; UIButton* button3 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; button1.frame = UIEdgeInsetsInsetRect(cell.contentView.bounds, UIEdgeInsetsMake(0, 0, 0, 250)); button2.frame = UIEdgeInsetsInsetRect(cell.contentView.bounds, UIEdgeInsetsMake(0, 125, 0, 125)); button3.frame = UIEdgeInsetsInsetRect(cell.contentView.bounds, UIEdgeInsetsMake(0, 250, 0, 0)); button1.autoresizingMask = UIViewAutoresizingFlexibleRightMargin; button2.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin; button3.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin; [cell.contentView addSubview:button1]; [cell.contentView addSubview:button2]; [cell.contentView addSubview:button3]; } return cell; } </code></pre> <p>Also, in the <code>tableView:willDisplayCell:</code> method of your delegate, do the following to have the default decoration of the cell totally disappear:</p> <pre><code>- (void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { cell.backgroundView = nil; } </code></pre> <p>You should obtain a result very similar to what you posted.</p>
 

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