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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:58:58+00:00 2026-06-13T05:58:58+00:00

How can I programmtically specify the location of a UISegmentedControl ? Setting the frame

  • 0

How can I programmtically specify the location of a UISegmentedControl? Setting the frame does nothing. And it seems like mySegmentedControl.frame returns the frame of the buttons and not the “bounding rectangle”.

I should note the segmented control I’m working with was added via interface builder.

Edit – more info: so I just learned that segmented controls usually go inside something like a UIToolbar. So I’ve created an IBOutlet reference to the toolbar created for me by the story board. When I log the location of this toolbar I can see the y-position as off from what I want. However setting the frame of this toolbar doesn’t seem to move it.

  • 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-13T05:59:00+00:00Added an answer on June 13, 2026 at 5:59 am

    Setting the frame is the proper way to do it. There is something else going wrong in your project. You can test this with a simple single view project with a UIButton and a UISegmentedControl:

    - (IBAction)buttonTapped:(id)sender {
        self.segmentedControl.frame = ((UIButton*)sender).frame;
        ((UIButton*)sender).hidden = YES;
    }
    

    This will set the segmented control with the same location & size as the button and then hide the button.

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

Sidebar

Related Questions

I know I can specify it in the configuration XML, but I'd like to
can I programmatically resize notification to size specify? My code js: var notification =
Does anyone know if you can programmatically save a report shown in a reportviewer
Does anyone know how I can programmaically move a registry from HKEY_LOCAL_MCAHINE to HKEY_CURRENT_USER?
I would like to dynamically specify the parent class for a class in Ruby.
I have a side panel like widget in my app that can be swiped
In their online developer docs, Google App Engine (GAE) mentions that you can specify
Can some one specify the windows API, one need to use in order to
The mac command say can specify the voice used with the -v flag. say
I understand you can specify a landscape, for the entire application but what if

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.