rs / SDSegmentedControl

A drop-in remplacement for UISegmentedControl that mimic iOS 6 AppStore tab controls
MIT License
1.2k stars 180 forks source link

Rotation animation is broken #44

Open bm-i opened 11 years ago

bm-i commented 11 years ago

The animation of the frame when autorotating is broken.

AFAIK the problem is due to all animations being removed in drawPathsFromPosition. Removing both lines re-enables the expected smooth transition of the frame.

However, another problem is that the animation duration is not in sync with the rotation animation duration. Temporarily setting the proper duration in willRotateToInterfaceOrientation:duration: and reseting it to the default in didRotateFromInterfaceOrientation is a workaround, but I think the problem is that the animation duration is used for both the animation of the selection and the path of the whole layer. It should only be used for the selection and the layer animation should be somehow in sync with whatever animation is currently occuring, but I couldn't figure out a proper fix.