Note that there are some explanatory texts on larger screens.

plurals
  1. POSubclassing UITableViewCell for grouped table
    primarykey
    data
    text
    <p>I'm trying to create a a custom subclass of a <code>UITableViewCell</code> to be used in a grouped table.</p> <p>I'm laying out the subclass with a <code>nib</code>. (I've just tried doing it without the nib but getting the same problem).</p> <p>Whenever I've done this before I've wanted to create a whole new cell style with a different background etc... so in <code>awakeFromNib</code> I do this...</p> <pre><code>- (void)awakeFromNib { // N.B. I am not doing this, this is how I normally get rid of border // in this case I want the border so I am not running this code. self.backgroundView = [[UIView alloc] initWithFrame:CGRectZero]; self.backgroundColor = [UIColor clearColor]; } </code></pre> <p>but in this case I want to keep the background with the rounded corners and I'm just adding different UI elements to it.</p> <p>The cell gets created and all the elements are laid out correctly but I'm getting an annoying "second border" in the top left corner of every section.</p> <p>I have a screen shot showing this.</p> <p><img src="https://i.stack.imgur.com/d7toW.png" alt="Screen shot of problem"></p> <p>At first I thought this was a hair on my screen or something but it isn't.</p> <p>I've tried setting the <code>backgroundView</code> and <code>backgroundColor</code> but that removes the normal cell background and I want to keep them.</p> <p>Any ideas how I can get rid of this?</p> <p><strong>EDIT</strong></p> <p>Just to clarify what I said above about setting <code>backgroundColor</code> and <code>backgroundView</code>.</p> <p>Here is what happens when I change them...</p> <p><img src="https://i.stack.imgur.com/szesP.png" alt="enter image description here"></p> <p>In this I set the <code>backgroundView</code> to <code>nil</code>. The border remains but so does the little bit I'm trying to get rid of.</p> <p><img src="https://i.stack.imgur.com/C6VsT.png" alt="enter image description here"></p> <p>If I set the <code>backgroundView</code> to a new <code>UIView</code> then this happens...</p> <p>I want the same background with the white background and the rounded corners border. Just not with that annoying little bit.</p>
    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