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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:06:24+00:00 2026-06-16T00:06:24+00:00

I have two UITable static sections in my application with both different headers. The

  • 0

I have two UITable static sections in my application with both different headers.
The color of the header must be changed because the custom background.

How can I do this solution like ( link ) in my MonoTouch application?

Because I use static sections, I don’t have a UITableViewSource where I can do stuff in.

My solution (thanks to Krumelur)

[Export("tableView:viewForHeaderInSection:")]
UIView GetViewForHeaderInSecion (UITableView tableview, int section)
{
    UIView view = new UIView (new RectangleF (0, 0, 300, 0));
    view.BackgroundColor = UIColor.Clear;

    UILabel label = new UILabel (new RectangleF (15, 5, 300, 25));
    label.BackgroundColor = UIColor.Clear;
    label.TextColor = UIColor.White;
    label.ShadowColor = UIColor.Black;
    label.ShadowOffset = new SizeF(0, 1);
    label.Font = UIFont.BoldSystemFontOfSize(18);

    if (section == 0) {
        label.Text = "First section";
    } else {
        label.Text = "Second section";
    }

    view.AddSubview(label);
    return view;
}
  • 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-16T00:06:25+00:00Added an answer on June 16, 2026 at 12:06 am

    You’ll have to export the missing method in your controller. Something like:

    [Export("tableView:viewForHeaderInSection:")]
    UIView GetViewForHeaderInSection(UITableView tableview, int section
    {
    // return your UIView with whatever background color here
    }
    

    Note that you cannot change the color of the predefined view but have to return an entire view instead.

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

Sidebar

Related Questions

I have two convex polygons in 3D. They are both flat on different planes,
Have two actionsheet buttons and one modalviewcontroller on mainviewcontroller in application. Now for two
I have two update panels on a page. And I want to update both
I have two queries that find both the Zip codes, and the States for
Have two fields start and end, both are dates, I want to write a
I have two questions regarding binary search trees, both about empty trees. Is an
I have two different objects of same entity Community And two objects(community and com)
I have two objects of classes Person and Employee. Both classes have common attribute
Have two files with struct definitions. Header: typedef struct _InputData InputData; extern InputData input_data;
I have two pages, Page A and Page B. Both of them have an

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.