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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:00:33+00:00 2026-06-04T13:00:33+00:00

I have created a segmented controller which has different sized segments. when i check

  • 0

I have created a segmented controller which has different sized segments.
when i check i see that segment controller has different width-size segments, but when i try to touch the biggest segment it only can be touched on left part of the segment. (probably just first 50 px part, but segment is 160 px). how can i set touchable area of the segment?

//My header file:        
#import <UIKit/UIKit.h>
@interface Form1 : UIViewController <UIAlertViewDelegate>{
IBOutlet UISegmentedControl *combobox6001;
}
@property (nonatomic, strong) IBOutlet UISegmentedControl *combobox6001;
@end

#import "Form1.h"
@implementation Form1
@synthesize combobox6001;
- (void) viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [combobox6001 setWidth:50  forSegmentAtIndex:0];
    [combobox6001 setWidth:50  forSegmentAtIndex:1];
    [combobox6001 setWidth:160 forSegmentAtIndex:2];
}
  • 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-04T13:00:34+00:00Added an answer on June 4, 2026 at 1:00 pm

    I had this same problem myself…it turns out that if you don’t set the width of the segment control itself before setting the width of it’s segments then you get this same problem up here. Here’s an example of what fixed this in my code (hope it helps!):

        [topSegmentedControl setFrame:CGRectMake(5.0, 5.0, frame.size.width - 26.0, topSegmentedControl.frame.size.height)];
    
        float width1 = round(topSegmentedControl.frame.size.width * 0.125);
        float width2 = round(topSegmentedControl.frame.size.width * 0.175);
        float width3 = round(topSegmentedControl.frame.size.width * 0.275);
        float width4 = topSegmentedControl.frame.size.width - (width1 + width2 + width3 + 3.0);
    
        [topSegmentedControl setWidth:width1 forSegmentAtIndex:0];
        [topSegmentedControl setWidth:width2 forSegmentAtIndex:1];
        [topSegmentedControl setWidth:width3 forSegmentAtIndex:2];
        [topSegmentedControl setWidth:width4 forSegmentAtIndex:3];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UISegmentedControl that has 6 segments which I created in Interface Builder.
I have a UISegmentedControl that has six segments, I want them to call a
I have created a UISegmentedControl with two segments using the interface builder (from storyboard),
i have created a simple public ref class in the vc++ project, which is
I have created a mini installer in NSIS that installs patches for my application.
I have an app that has two viewcontrollers Viewcontroller and OptionsViewController. Viewcontroller is the
I have a segmented control on the top of a tableView that I would
I have a view that has a UISegmentedControl in its bottom UIToolBar with 2
I have a HTTP Live streaming server setup that serves segmented mp3 audio content
I have created an up/down arrow segmented control button on the right side of

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.