DavidNg DavidNg - 1 year ago 99
iOS Question

iOS: change the height of UISegmentedcontrol

I am trying to change the height of UISegmentedcontrol, but it is not allowed in the Interface Builder. Is there any way to change or it is impossible?


Answer Source

Yes, you can use [mySegmentedControl setFrame:frame] in code. It is unfortunate that you can't do this in IB.

So, if you just want to change the height:

CGRect frame= mySegmentedControl.frame;
[mySegmentedControl setFrame:CGRectMake(frame.origin.x, frame.origin.y, frame.size.width, fNewHeight)];