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).
and after:
rotation done by:
ytitleview.translatesautoresizingmaskintoconstraints = no; ytitlelabel.transform = cgaffinetransformmakerotation (-3.14/2);
constraints between sleepscoreuilabel
, blue uiview
keep distance between them:
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; });
Comments
Post a Comment