ios - Change Position Of a UIView programatically -
there arabic page in app , "date field" in arabic page must align right side of view(right now, left). have tried following code
-(void)changedateposition{ if (!_isenglish) { cgrect currentdatepostion=_viewfordate.frame; [_viewfordate removefromsuperview]; currentdatepostion.origin.x+=currentdatepostion.size.width; _viewfordate.frame=currentdatepostion; [_baseview addsubview:_viewfordate]; } }
but did not help. view positioned top of navigation bar(no change in x co-ordinate,either). have used autolayout align left leading space of "viewfordate"(the date field) leading space of "placesview"(the view on top of date field). set priority 250. how can solve problem?
hook iboutlet leading constraint of date view , set value 0. , try code:
-(void)changedateposition{ if (!_isenglish) { _dateviewleadconstraint.constant = x; } //x - amount view should move right, can calculate based on view setup }
Comments
Post a Comment