How do I switch UIsegmentedControl programmatically?

后端 未结 6 1508
孤独总比滥情好
孤独总比滥情好 2021-02-01 11:47

How do I switch UISegmentedControl programmatically ?

6条回答
  •  感情败类
    2021-02-01 12:13

    The selectedSegmentIndex property identifies the selected segment of a UISegmentedControl. Set this property to the any valid segment index, or UISegmentedControlNoSegment (-1) to turn off the current selection.

    // select the first segment
    segmented.selectedSegmentIndex = 0;
    
    // turn off the current selection
    segmented.selectedSegmentIndex = UISegmentedControlNoSegment;
    

提交回复
热议问题