Is there any simple way which can help me to change position of dependent views dynamically using their content size?
I want to show several views in column which al
This works too. https://github.com/jszumski/auto-layout-table-cells/blob/master/DynamicCellHeights/JSLabel.m
@interface JSLabel : UILabel
@end
@implementation JSLabel
- (id)init {
self = [super init];
// required to prevent Auto Layout from compressing the label (by 1 point usually) for certain constraint solutions
[self setContentCompressionResistancePriority:UILayoutPriorityRequired
forAxis:UILayoutConstraintAxisVertical];
return self;
}
- (void)layoutSubviews {
[super layoutSubviews];
self.preferredMaxLayoutWidth = CGRectGetWidth(self.bounds);
[super layoutSubviews];
}
@end