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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:33:36+00:00 2026-06-10T22:33:36+00:00

Ive added a segmented control to the header of a uitableview. this works fine.

  • 0

Ive added a segmented control to the header of a uitableview. this works fine. but for some reason i cannot make the segmented buttons (or at least just the first button) have a red background color. it just loads with the default silver.

-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    UIView* NEWview = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
    NEWview.backgroundColor = [UIColor colorWithRed:78.0/255.0f green:88.0/255.0f blue:74.0/255.0f alpha:1.0]; 
    NSArray *itemArray = [NSArray arrayWithObjects: @"Organisations", @"Events", nil];
    UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:itemArray];
    segmentedControl.frame = CGRectMake(15, 5, 290, 30);
    segmentedControl.segmentedControlStyle = UISegmentedControlStylePlain;
    segmentedControl.selectedSegmentIndex = 1;
    UIColor *newSelectedTintColor = [UIColor redColor];
    [[[segmentedControl subviews] objectAtIndex:0] setTintColor:newSelectedTintColor];
    [NEWview addSubview:segmentedControl];
    return NEWview;
}

Any Ideas? Thanks in advance for any help..

  • 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-10T22:33:38+00:00Added an answer on June 10, 2026 at 10:33 pm

    Tint color for segmentedcontrol works only if segmented control is of bar style.

    segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
    segmentedControl.tintColor=[UIColor redColor];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ive added the using Microsoft.SharePoint.Client; But still getting errors, is it some dll i
Hello ive added two new functions to the implementation of an interface. this is
Ive added buttons to my view programmatically and i want to later on change
So ive added a mapfield to my page. It creates everything you'd expect. ie.
QUESTION ONE: In the following example, ive added a listener to the foundMic. My
I've added the Google MAPs API to my app, but it's not a critical
I've added # config/initializers/will_paginate_array_fix.rb require 'will_paginate/array' but still do not seem to be getting
I've added a pre-build action for an ASP.NET web control (server control) project, that
For a little practise fun project I did this: I added a grid of
I wanted to test the following code (which works fine for a non-null list)

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.