1

I'm using Auto Layout to set UILabel constraints like follow:

[self.leadNewsLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
    make.left.equalTo(self.containerForNewsText.mas_left).with.offset(16);
    make.top.equalTo(self.containerForNewsText.mas_top).with.offset(16);
    make.right.equalTo(self.containerForNewsText.mas_right).with.offset(-16);
    make.height.greaterThanOrEqualTo(@(50));
    make.bottom.equalTo(self.truncatedNewsText.mas_top).with.offset(-20); 
}];

I use Masonry lib to programmatically add constraints, syntax is pretty straightforward. However, for some reason UILabel expand its borders. Please take a look at screenshot from debugger:

enter image description here

You can easily see that label borders are not the same as text borders. How could i fix it?

AtheistP3ace
  • 9,611
  • 12
  • 43
  • 43
Evgeniy Kleban
  • 6,794
  • 13
  • 54
  • 107

0 Answers0