UISegmentedControl deselect (make none of the segments selected)

前端 未结 8 2076
我寻月下人不归
我寻月下人不归 2021-02-01 01:30

in fact the title contains my question. I have a UISegmentedControl, and need to deselect currently selected tab. I tried:

[menu setSelectedSegmentIndex:-1];
         


        
8条回答
  •  -上瘾入骨i
    2021-02-01 01:57

    I guess you try to create a momentary selection in segmented control. In interface builder set the segmentedcontrol to momentary. Or in code you can do:

    menu.momentary = YES;
    

提交回复
热议问题