【发布时间】:2012-10-16 19:26:51
【问题描述】:
我有一个 UISegmentedControl,它的“Value changed”事件在 Interface Builder 中被连接起来,以调用我的控制器的 -(IBAction)segmentChangeAction:(id)sender;
当用户点击控件以更改所选段时,无论在 iOS4 还是 iOS5 中,都会按预期调用 segmentChangeAction。
当我通过segmentedControl.selectedSegmentIndex = newIndex; 以编程方式更改所选段时,在iOS4 上调用segmentChangeAction 并且该段反映了新的选择。然而在 iOS5 segmentChangeAction 上没有被调用,但该段确实反映了新的选择。
这是 iOS5 的变化吗?当我以编程方式更改选择时,我可以做些什么来在 iOS5 上调用 segmentChangeAction?
【问题讨论】:
标签: iphone ios ios5 uisegmentedcontrol