Reputation: 8003
I wish use a uisegmentedcontrol in my app with 3 segments but not with the same size, the first and the third smaller than the second... is this possible? how can I do this? thanks
Upvotes: 4
Views: 3943
Reputation: 1583
Try this code it helped me:
segmentedControl.apportionsSegmentWidthsByContent = true
Upvotes: 3
Reputation: 8138
This sure works:
[self.mySegmentedControl setWidth:30.f forSegmentAtIndex:0];
Upvotes: 5
Reputation: 2440
Try with:
[yourSegmentedController widthForSegmentAtIndex:indexOfSegmentYouWantToChange];
Hope it helps.
EDIT:
Can be better to do:
[yourSegmentedController sizeToFit];
Upvotes: 2