Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tableView.estimatedRowHeight = 83.0
- tableView.rowHeight = UITableViewAutomaticDimension
- -(CGFloat)tableView:(UITableView*)tableView heightForRowAtIndexPath:(nonnull NSIndexPath *)indexPath
- {
- return UITableViewAutomaticDimension;
- }
- self.tableView.estimatedRowHeight = 60; // required value.
- UILabel * label = [UILabel new];
- [self.contentView addSubview:label];
- NSDictionary * views = NSDictionaryOfVariableBindings(label);
- //Inset 5 px
- [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-5-[label]-5-|" options:0 metrics:nil views:views]];
- [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-5-[label]-5-|" options:0 metrics:nil views:views]];
- // height >= 44
- [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.mainLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationGreaterThanOrEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:44.0]];
Add Comment
Please, Sign In to add comment