I am trying to change height of UISegmentedControl
using this code:
CGRect frame= mySegmentedControl.frame;
[mySegmentedControl setFrame:CGRectM
Perhaps this will help: I had a custom-sized UISegmentedControl within a Storyboard view. The Storyboard views were utilizing AutoLayout and each time I pressed one of the segments, the UISegmentedControl would resize to the default height and not to the custom frame size.
My solution:
1) Set the UISegmentedControl frame in -(void)viewDidLoad:
[mySegControl setFrame:CGRectMake(100, 170, 568, 100)];
2) Set the frame in -(void)viewDidLayoutSubviews:
[mySegControl setFrame:CGRectMake(100, 170, 568, 100)];
3) In the method you use as the target for when a segment is selected, call setNeedsLayout. This will force the UISegmentedControl to be re-laid-out IAW your custom frame size
[self.view setNeedsLayout];