0
-(POPSpringAnimation *)sizeAnimation:(NSValue*)toValue{
    POPSpringAnimation *sizeAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewFrame];
    sizeAnimation.toValue = toValue;
    sizeAnimation.springBounciness = 10.0f;
    sizeAnimation.dynamicsFriction = 30.0f;
    return sizeAnimation;
}

I use this POPAnimation to transform my View but it seems that the labels in the View did not animate follow their superView, looks strange.

Tristan
  • 3,301
  • 8
  • 22
  • 27
罗月麒
  • 9
  • 1
  • You should use auto layout to pin the label to the superview. Also try if you can perform the animation by modifying the constraints instead of the frame, because modifying frame after specifying constraints get your constraints to break and is not recommended. – Skywalker Jan 07 '16 at 04:52
  • Tank you so,but i'm still very confused,beacuse i'm a novice,can you recommend some demo to me? – 罗月麒 Jan 08 '16 at 02:07

1 Answers1

0

Use Autolayout to pin the UILabel to its superview. This will ensure that your UILabel's bounds will get updated to that of the superview when superview's bounds get updated.

Animating using autolayout is another topic entirely, but will help you accomplish what you want. Ever since autolayout happened, its best to use it.

Follow this link - http://useyourloaf.com/blog/animating-autolayout-constraints.html

Hope it helps.

Skywalker
  • 1,590
  • 1
  • 18
  • 36