Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><em>This solution will work for iOS7, as well as previous versions of iOS.</em></p> <p>Create a custom UITableView cell class and override UITableViewCell. In setFrame you can adjust desired cell size. Both setFrame and setAlpha are called after tableView:willDisplayCell:forRowAtIndexPath: so any accessory views and image views display correctly.</p> <p>reference : <a href="https://developer.apple.com/library/ios/documentation/uikit/reference/UITableViewDelegate_Protocol/#//apple_ref/occ/intfm/UITableViewDelegate/tableView:willDisplayCell:forRowAtIndexPath" rel="nofollow noreferrer">https://developer.apple.com/library/ios/documentation/uikit/reference/UITableViewDelegate_Protocol/#//apple_ref/occ/intfm/UITableViewDelegate/tableView:willDisplayCell:forRowAtIndexPath</a>:</p> <pre><code>@interface CustomTableViewCell : UITableViewCell @end @implementation CustomTableViewCell -(void) setFrame:(CGRect)frame { float inset = 20.0f; frame.origin.x += inset; frame.size.width -= 2 * inset; [super setFrame:frame]; } @end </code></pre> <p>In cellForRowAtIndexPath replace UITableViewCell with CustomTableViewCell. </p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { CustomTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CustomTableViewCell" forIndexPath:indexPath]; ... } </code></pre> <p>In your storyboard file set your Prototype cell class to <strong>CustomTableViewCell</strong> and it is identifier to <strong>"CustomTableViewCell"</strong></p> <p><img src="https://i.stack.imgur.com/xWdd1.png" alt="IndentedGroupedTableViewCell"></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