Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deleselect uisegmentedcontrol selection after clicking on a save button

I'm using a 3 button UISegmented control for a choice selection. I also have a save button that retrieves the chosen control.

When the save button is clicked I want to have to UISegmentedcontrol cleared (ie the previous selected button unselected). I'm not looking for the setMomentary as I want the selection to stick but also be able to unselect it later.

like image 456
Ayrad Avatar asked Jan 08 '12 13:01

Ayrad


Video Answer


2 Answers

[myUISegmentedControl setSelectedSegmentIndex:UISegmentedControlNoSegment];
like image 104
lelot Avatar answered Oct 19 '22 16:10

lelot


myUISegmentedControl.selectedSegmentIndex = -1; //turn off the current selection
like image 37
Tomasz Wojtkowiak Avatar answered Oct 19 '22 15:10

Tomasz Wojtkowiak