Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding a subview larger than cellHeight to a UITableViewCell?
    text
    copied!<p>I'm trying to add a subview to a UITableViewCell and the design that I'm working from demands that this particular subview (an image) needs to be larger than the actual UITableViewCell and thus partly overlap its siblings.</p> <p>So I've set up my table cell, generated my image and added it to the cell's contentView:</p> <pre><code>// rowHeight for the UITableView is 45.0f UIImage *image = [self createCellThumbnail: someImage]; UIImageView *thumbView = [[UIImageView alloc] initWithFrame: CGRectMake(150, -5, 55,55)]; thumbView.transform = CGAffineTransformMakeRotation(0.1f); thumbView.image = image; cell.clipsToBounds = NO; cell.contentView.clipsToBounds = NO; [cell.contentView addSubview: thumbView]; </code></pre> <p>While the image will 'overflow' into the cell below it, the top of the image is always clipped, as demonstrated here:</p> <p><a href="https://i.stack.imgur.com/wbWdR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wbWdR.png" alt="img"></a></p> <p>Does anyone know if what I'm trying to do is possible with the current approach?</p> <p>Or should I just figure out a way to draw these images onto the UITableView after all the cells are drawn (it's a non-scrollable tableview, so that would work and be fairly easy).</p> <p><strong>Update:</strong> </p> <p>Have also tried adding the following, to no avail:</p> <pre><code>cell.opaque = NO; cell.contentView.opaque = NO; cell.clearsContextBeforeDrawing = NO; cell.contentView.clearsContextBeforeDrawing = NO; cell.clipsToBounds = NO; cell.contentView.clipsToBounds = NO; </code></pre>
 

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