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.
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:
This will set the segmented control with the same location & size as the button and then hide the button.