ios - Auto layout: changing a view's center x alignment programatically -
ios - Auto layout: changing a view's center x alignment programatically -
i have image view x centered label above it.
after tapping button, want image view x centered label. tried connecting constraint outlet , replacing new nslayoutconstraint (since cannot modify sec item) calling layoutifneeded on parent view, doesn't seem change.
[self.tabsview layoutifneeded]; self.tabindicatorcenterxalignment = [nslayoutconstraint constraintwithitem:self.tabindicatoriv attribute:nslayoutattributecenterx relatedby:nslayoutrelationequal toitem:_tabsbtnarray[pagenumber] attribute:nslayoutattributecenterx multiplier:1.0 constant:0]; [uiview animatewithduration:0.5 animations: ^{ [self.tabsview layoutifneeded]; }];
ios xcode autolayout
Comments
Post a Comment