Andrew
Andrew

Reputation: 16051

Change value of a segmented control?

How do i change the value of a segmented control through code?

Upvotes: 3

Views: 7273

Answers (3)

raaz
raaz

Reputation: 12490

You can change the segment control value by using property selectedSegmentIndex

For Ex. segmentedControlObject.selectedSegmentIndex=1;

For Tutorial you can refer this

Upvotes: 0

Ilya Saunkin
Ilya Saunkin

Reputation: 19800

[segmentedControl setSelectedSegmentIndex:(NSInteger)]

Upvotes: 5

fsaint
fsaint

Reputation: 8759

UISegmentedControl *cont;
.....
cont.selectedSegmentIndex = 4; //Selected index you want;

Upvotes: 15

Related Questions