ios - UIView with rotation not resizing -


i've created uiview containing uilabel inside (as suggested in: autolayout rotated ui elements). problem not want autolayout when rotate 90 degrees (see pictures).

image before rotation: image before rotation

and after:

enter image description here

rotation done by:

ytitleview.translatesautoresizingmaskintoconstraints = no; ytitlelabel.transform = cgaffinetransformmakerotation (-3.14/2); 

constraints between sleepscoreuilabel , blue uiview keep distance between them:

enter image description here

edit1: tried suggestions of @bennegeek

 ytitlelabel.translatesautoresizingmaskintoconstraints = yes;     cgrect frame = ytitlelabel.frame;     bottom.active = no;     top.active = no;     leading.active = no;     trailing.active = no;     ytitlelabel.transform = cgaffinetransformmakerotation (-m_pi/2);      dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_default, 0), ^{         ytitlelabel.frame = frame;     }); 

but result is: enter image description here

if after operations turn constraints active, get: enter image description here


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -