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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:37:29+00:00 2026-05-11T09:37:29+00:00

A quick question about the UISegmentedControl class on the iPhone. Hopefully, some may have

  • 0

A quick question about the UISegmentedControl class on the iPhone.

Hopefully, some may have noticed how in its default state with 2 segments, the segmented control still will toggle even if the user taps on a segment that is currently selected.

I’ve seen UISegmentedControls in apps that negate that behaviour and don’t toggle when the user presses a selected segment. Namely, Apple’s iTune Store app.

Is there a simple way of preventing this behaviour that I’m overlooking, or do I need to write some logic into the valueChanged?

I’ve been trying to disable currently selected segments and enabling unselected ones, but this seems to change the appearance of the control when I don’t want it do.

Any ideas?

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T09:37:30+00:00Added an answer on May 11, 2026 at 9:37 am

    Look in the UISegmentedControl.h header file (an easy way is to double click on ‘UISegmentedControl’ in XCode with Command held down).

    In there you’ll see a number of items in a _segmentedControlFlags struct. If you make a category on UISegmentedControl, you can manipulate any of those elements – including dontAlwaysToggleForTwoSegments which as you might guess by the name is what you are looking for.

    Since this is documented in the API header (though not in the actual documentation) it should be pretty safe to use.

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

Sidebar

Related Questions

I have quick question about jQuery plugins, hope somebody out there has some advice.
Just a quick question about the Timer class of Flex 4. I have a
I have a quick question about fetching results from a weakly typed cursor and
I've got a quick question about default values in PL/SQL functions in Oracle. Take
I just have a quick question about how to get the length of a
I have a quick question about encapsulating specific types with typedef . Say I
Quick question about CI. I have a view with a form, several text input
A quick question about saving data in symfony 2. I have this method (just
I just have a quick question about the conditional operator. Still a budding programmer
Have a quick question about what would be the best way to implement iterators

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.