ios - AutoLayout for a left/right aligned view -
ios - AutoLayout for a left/right aligned view -
problem
i'm trying create uitableviewcell subclass work bit in messages app left aligned , right aligned.
when left aligned this... (in pseudo afl code).
|-[image(==30)]-[label]-(>=standard)-| ...and when right aligned be...
|-(>=standard)-[label]-[image(==30)]-| first solution
i thinking have couple of methods this...
- (void)setupleftalignedconstraints; - (void)setuprightalignedconstraints; - (void)removealignmentconstraints; so can like...
if (self.leftaligned) { [self removealignmentconstraints]; [self setupleftalignedconstraints]; } else { [self removealignmentconstraints]; [self setuprightalignedconstraints]; } but know if utilize leading , trailing attributes automagic based on writing direction of current language.
is possible set direction of constraints manually?
i.e. tell if leading left or right edge?
that way need alter setting , constraints work both ways.
ios objective-c autolayout
Comments
Post a Comment