2011-07-15 334 views

回答

17

附加目標動作控制事件UIControlEventValueChanged

[segmentedControl addTarget:self action:@selector(valueChanged:) forControlEvents: UIControlEventValueChanged]; 
4

可以使用addTarget:動作:forControlEvents方法。

UISegmentControl *mySegmentedControl = [UISegmentControl ...]; 
[mySegmentedControl addTarget:self action:@selector(segmentValueChanged:) forControlEvents:UIControlEventValueChanged];