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 7784185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:03:16+00:00 2026-06-01T20:03:16+00:00

I am currently creating my own custom section headers but I have never dont

  • 0

I am currently creating my own custom section headers but I have never dont any text editing via code.. and my new method that I am using to populate my custom header is doing some weird things as shownenter image description here below

I would like to change the text to white and be slightly bolder and also make the white background transparent..

this is the code I am using to do this

- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 
{
    UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 30)];
    [headerView setBackgroundColor:[UIColor grayColor]];

    // Add the label
    UILabel *headerLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.5, 20, 20)];

    // do whatever headerLabel configuration you want here


    headerLabel.text = [self tableView:tableView titleForHeaderInSection:section];
    [headerView addSubview:headerLabel];

    // Return the headerView
    return headerView;
}

I have tried this

[headerLabel.backgroundColor:[UIColor clearColor]];

etc but its not working 🙁

  • 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-01T20:03:17+00:00Added an answer on June 1, 2026 at 8:03 pm

    I would like to change the text to white…

    UILabel’s textColor property is your friend here.

    And slightly bolder…

    No problem! headerLabel.font = [UIFont boldSystemFontOfSize:mySize];

    And make a white transparent background.

    Whoa, whoa, that is the worst setter syntax ive ever seen!!! My lord, myLabel.backgroundColor is a getter, change:

    [headerLabel.backgroundColor:[UIColor clearColor]];
    

    to:

    [headerLabel setBackgroundColor:[UIColor clearColor]];
    

    Lucky for you, using your syntax would have just sent a message to nil, which is defaulting the background color of your label to white.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently in the process of creating my own blog and I have
Im currently creating my own forum for my website and i have read plenty
I am creating a custom text box control to have some default formatting and
im currently creating a graph for an app, using coreplot and have a problem
I'm currently creating a Flash CMS via Flex and the Zend Framework. In the
Short Intro Currently I have a UITableView which is filled with custom cells that
I'm creating my own HTML5 audio player capable of handling playlists. I have created
Currently creating a VOIP application for Android and I was wondering is there any
I'm creating my own UserControl and I have two different DataTemplates under the UserControl.Resources
I'm currently creating some custom helper classes, similar to ASP.NET MVC's standard HtmlHelper .

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.