How to disable part of UISegmentedControl?

前端 未结 2 710
陌清茗
陌清茗 2021-02-03 17:37

Following is the code for UISegmentedControl

UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObje         


        
2条回答
  •  自闭症患者
    2021-02-03 17:45

    Use setEnabled:forSegmentAtIndex: method to enable and disable the segments.

    [segmentedControl setEnabled:NO forSegmentAtIndex:0];
    

    if you want to disable the first segment.

提交回复
热议问题