سؤال

I'm having an issue with animating a UIButton into a new position.

The code I'm using is as follows:

[UIView animateWithDuration:kFadeAnimationInterval
                 animations:^{
                     button.frame = newFrame;
                 }];

Executing the code does not have any effect on the button's position. Not sure if it's related, but the Interface is laid out in a NIB file.

Any suggestions?

هل كانت مفيدة؟

المحلول

Are you using AutoLayout to position the button? That might be the causing issues with changing the position in your animation.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top