Note that there are some explanatory texts on larger screens.

plurals
  1. POAutoLayout and UILabel resize animation not working properly on device rotation
    primarykey
    data
    text
    <p>i have a strange problem on a very simple task.</p> <p>I needs a very small setup to reproduce the problem:</p> <pre><code>|--------------------------------------| | Parent View | | | ||------------------------------------|| || UILabel || ||------------------------------------|| | | | | ||------------------------------------|| || UIView || ||------------------------------------|| | | | | |--------------------------------------| </code></pre> <p>In the example above we have a parent view with 2 subviews --> A UILabel and a simple UIView. Im using autolayout to apply the layout shown above:</p> <pre><code>Constraints for UILabel: Leading Space to superview = 0 Trailing Space to superview = 0 Fixed Height constraint (e.g. 80pt) Top Space constraint (e.g. 50pt) The UIView subview has the same constraint types (the values for height and top space differs). </code></pre> <p>So what i expect with this setup, is that both subviews will adopt the full width of its parent as we defined that leading and trailing space should be zero. so if change the width of the parent view, the width of the subviews should change too, to stay aligned.</p> <p>lets say the parent view has a dimension of 200x400 pt. when i build and run my example in portrait everything looks ok. when i rotate to landscape, everything still looks fine. the parent views width and even the subviews width got larger. but now when i rotate back to portrait the uilabels width immediately gets its target width without any animation:</p> <pre><code>|--------------------------------------| | Parent View | | | | (immediately has target size) | | |--------------| | | | UILabel | | | |--------------| | | | | (this subview is still | | animating its width) | | |------------------------------| | |--&gt;| UIView |&lt;--| | |------------------------------| | | | | | |--------------------------------------| </code></pre> <p>the parent views width and the uiview subviews width are animated properly. its only the uilabel that has a strange behavior here and i cant find out what causes that issue.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload