我有9个分段控件,每个控件都有3个分段,我在所有的控件上都选择了分段3,现在想在每个控件上禁用前2个分段,目前的代码如下,我需要做哪些更改?
[q2SegControl, q3SegControl, q4SegControl, q5SegControl, q6SegControl, q7SegControl, q8SegControl, q9SegControl, q10SegControl].forEach {
segmentedControl.setEnabled=false,forSegmentAt:0,1}
我相信你必须这样使用。
[q2SegControl, q3SegControl, q4SegControl, q5SegControl, q6SegControl, q7SegControl, q8SegControl, q9SegControl, q10SegControl].forEach { segmentedControl in
segmentedControl.setEnabled(false, forSegmentAt: 0)
segmentedControl.setEnabled(false, forSegmentAt: 1)
}