Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8411295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:23:42+00:00 2026-06-10T00:23:42+00:00

I’m trying to implement a control for deleting entire sections, and it would look

  • 0

I’m trying to implement a control for deleting entire sections, and it would look best in my app if the delete button was in the header, as opposed to an overlay like a UIPopoverView.


In the process of writing this question, I found the answer. Easy enough, once there’s a starting point.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:23:43+00:00Added an answer on June 10, 2026 at 12:23 am

    I got the bulk of the code from this blog which has only two posts, both from 2010.
    Then I went back to this site just for the font color, since it’s more trouble to break apart.

    Three minor problems, all with the label.

    - Font is too narrow
    - Text color is too dark
    - Label origin is wrong
    

    The default font is known, so that comes first.

    label.font = [UIFont boldSystemFontOfSize:17.0];
    

    Color is next, since that’s easy. Used an image editor’s Eyedropper tool for this.

    label.textColor = [UIColor colorWithRed:0.298 green:0.337 blue:0.423 alpha:1];
    // Is there a difference between alpha:1 and alpha:1.000?
    

    Then the hard part. A close guess, and then some tweaking for a perfect match.

    label.frame = CGRectMake(54, 4, headerView.frame.size.width-20, 22);
    

    And now we have a custom implementation that perfectly matches the current Grouped header.

    Finished code:

    - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
        UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, 40)];
        tableView.sectionHeaderHeight = headerView.frame.size.height;
    
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(54, 4, labelSize.width, labelSize.height)];
        [label setBackgroundColor:[UIColor clearColor]];
        [label setFont:[UIFont boldSystemFontOfSize:17.0]];
        [label setShadowColor:[UIColor whiteColor]];
        [label setShadowOffset:CGSizeMake(0, 1)];
        [label setText:[self tableView:tableView titleForHeaderInSection:section]];
        [label setTextColor:[UIColor colorWithRed:0.298 green:0.337 blue:0.423 alpha:1.000]];
        [headerView addSubview:label];
    
        return headerView;
    }
    

    Found this SO answer after finding the right font/color myself. Oh well.

    Edit:

    For a title label that allows an effectively unlimited amount of text:

    // before label init
    NSString *title = [self tableView:tableView titleForHeaderInSection:section];
    NSUInteger maxWidth = headerView.frame.size.width-108;
    CGSize labelSize = [title sizeWithFont:[UIFont systemFontOfSize:17.0]
                         constrainedToSize:CGSizeMake(maxWidth, CGFLOAT_MAX)];
    if (labelSize.width < maxWidth) labelSize.width = maxWidth;
    
    // after setFont:
    [label setNumberOfLines:0];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm trying to select an H1 element which is the second-child in its group

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.