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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:03:19+00:00 2026-06-15T08:03:19+00:00

I am globally setting the appearance for all my UISegmentedControl’s. However I noticed that

  • 0

I am globally setting the appearance for all my UISegmentedControl’s. However I noticed that when I do this it breaks the disabled state.

Here is the code I have to change the titleTextAttributes

NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:
                                [UIFont boldSystemFontOfSize:12], UITextAttributeFont,
                                [UIColor whiteColor], UITextAttributeTextColor,
                                [UIColor colorWithRed:0x49/255.0 green:0x49/255.0 blue:0x49/255.0 alpha:1], UITextAttributeTextShadowColor,
                                [NSValue valueWithUIOffset:UIOffsetMake(0, -1)], UITextAttributeTextShadowOffset,
                                nil];
[[UISegmentedControl appearance] setTitleTextAttributes:attributes forState:UIControlStateNormal];

Now this works great and all segmented controllers are updated.

But the items that I had disabled with setEnabled:forSegmentAtIndex: aren’t disabled anymore and are clickable. Why does this happen? How can I get them to be disabled again. I tried to apply it to the disabled state as well but it doesn’t work.

[[UISegmentedControl appearance] setTitleTextAttributes:attributes forState:UIControlStateDisabled];
  • 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-15T08:03:20+00:00Added an answer on June 15, 2026 at 8:03 am

    Well it appears that setting a global appearance for the UISegmentedControl wasn’t the best approach as it does not honor the UIControlStateDisabled.

    I thought I had to use UIControlStateDisabled since nothing was working, but it appears that setting the background directly works. So I just ended up making a UISegmentedControlExtended class that initializes the background and now the setEnabled function works fine.

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

Sidebar

Related Questions

In code one can specify globally accessible constants/enums/etc once that can then be reused
How do I select the globally-last text node using xpath? I tried this, but
I am using the appearance proxy to adjust my color settings globally: //Setup custom
I'm setting individual page titles in my controllers' actions using: $this->set( 'title_for_layout', 'Some Title'
I have this setting. root dir| index.php config.php file.php | | |scripts|a.js | |account
We have a lot of code in our codebase that was done by a
I am reviewing this technology but have a few design concerns that made me
Im working on an mvc3 application that will be deployed globally and have a
I'm sure that this question has already been asked, but I don't really see
I can do them per-project (select project, Settings, Versions), but not globally. How do

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.