Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's another way to do that w/out the grouped table style, and one you'd probably not guess. Adding <strike>a header and</strike> footer to the table <strike>(perhaps one or the other suffices, haven't checked)</strike> causes the separators to disappear from the filler/blank rows.</p> <p>I stumbled onto this because I wanted a little space at the top and bottom of tables to decrease the risk of hitting buttons instead of a table cell with meaty fingers. Here's a method to stick a blank view in as header and footer. Use whatever height you like, you still eliminate the extra separator lines.</p> <pre><code>- (void) addHeaderAndFooter { UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 10)]; v.backgroundColor = [UIColor clearColor]; [self.myTableView setTableHeaderView:v]; [self.myTableView setTableFooterView:v]; [v release]; } </code></pre> <hr> <p>In response to @Casebash, I went back to the code in my app ("AcmeLists" List Manager in iTunes store...) and short-circuited the addHeaderAndFooter method to verify. <strong>Without it</strong>, I have the extra row separators; with the code, I have what you see in this window snap: <a href="http://grab.by/1LE2" rel="nofollow noreferrer">no table row separators picture</a>. So I'm not sure why it wouldn't have worked for you. Moreover, it makes sense to me that having any custom footer on a table view would necessarily have to stop drawing row separators for blank rows below it. That would be hideous. For reference, I looked at tables where there were more rows than could be viewed on screen, and then for a table with two rows. In both cases, no extraneous separators.</p> <p>Perhaps your custom views were not actually added. To check that, set the background color to something other than <code>clearColor</code>, e.g., <code>[UIColor redColor]</code>. If you don't see some red bars at the bottom of the table, your footer wasn't set.</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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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