Fixed an animation problem on iOS 7

Immediately layout subviews when changing state, otherwise changes in layoutSubviews will be animated on iOS 7.