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
Asked
Active
Viewed 3,935 times
3 Answers
5
This sure works:
[self.mySegmentedControl setWidth:30.f forSegmentAtIndex:0];

Borut Tomazin
- 8,041
- 11
- 78
- 91
3
Try this code it helped me:
segmentedControl.apportionsSegmentWidthsByContent = true

Stan
- 1,513
- 20
- 27
2
Try with:
[yourSegmentedController widthForSegmentAtIndex:indexOfSegmentYouWantToChange];
Hope it helps.
EDIT:
Can be better to do:
[yourSegmentedController sizeToFit];

IssamTP
- 2,408
- 1
- 25
- 48
-
Would you need to subclass UISegmented control first? – Echilon Aug 15 '11 at 14:15
-
No. At least for the SDK I used at that time. – IssamTP Aug 15 '11 at 20:33