UILabel ugly rotation animation with autoplay

I have a simple UILabel inside a UIView that follows these constraints:

H:|[label]|

      

During the rotation from Landscape

to animation, the Portrait

handle is "unhooked" to the right of the ugly animation.

The following photos should describe the situation better than me:

Step 1 - Step 2 - Step 3

The label seems to have set its final width at the start of its animation.

It also goes from Portrait

to Landscape

, but it's less disturbing since end width> start width (detach effect).

Has anyone already found a workaround for this problem?

+3


source to share


1 answer


I had the same problem and solved it by changing some restrictions. It might be an easier solution for you (if you haven't solved it better yet) or someone else with the same situation.

I had trailing and leading space constraints for my labels that are centered.



I changed these constraint constants from "=" to "> =" and created one new alignment constraint to center the labels horizontally in the container view.

They all look great during rotation animation.

+2


source







All Articles