配置 UISegmentedControl 动画

Configuring UISegmentedControl Animation

documentation

When you add and remove segments, you can request that the action be animated with sliding and fading effects.

post 展示了一种手动删除动画的方法。但是既然文档里说了,难道就没有更好的办法吗?

您可以使用以下方法启用或禁用动画:

- insertSegmentWithImage:atIndex:animated:
– insertSegmentWithTitle:atIndex:animated:
– removeSegmentAtIndex:animated: