开发者

Animating UIView center property not working on willRotateToInterfaceOrientation

开发者 https://www.devze.com 2023-03-25 10:57 出处:网络
I\'m animating a subview in the UIViewController\'s willRotateToInterfaceOrientation. First, I was setting its frame to a new position and it was working fine. Since I just animate the positioning I t

I'm animating a subview in the UIViewController's willRotateToInterfaceOrientation. First, I was setting its frame to a new position and it was working fine. Since I just animate the positioning I tried to animate the center property instead. As soon as I do it, the animations do not work anymore.

I'm using UIView's animateWithDuration and when checking the completion block, the finished parameter is always NO. Animating the center property on other events like a button click works fine.

Might it be that the rotation algori开发者_高级运维thm iOS uses to reposition a view's subviews also touches the center property and cancel's my animation?

0

精彩评论

暂无评论...
验证码 换一张
取 消