gsdios / SDAutoLayout

One line of code to implement automatic layout. 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于做最简单易用的AutoLayout库。The most easy way for autoLayout. Based on runtime.
MIT License
5.9k stars 1.28k forks source link

UILable的attributedText,刷新的的时候数据改变,但是UILable的width不变,导致显示不全问题。 #339

Open JPIOS opened 3 years ago

JPIOS commented 3 years ago

代码布局如下:

-(void)setup { [super setup];

CGFloat space = 16; _titleLb = [[UILabel alloc] initWithTextColor:UIColorFromRGB(0x2D2D2D) font:[UIFont gs_systemFontOfSize:14 weight:regular]]; [self.contentView addSubview:_titleLb]; _titleLb.sd_layout .xIs(space) .rightSpaceToView(self.contentView, space) .yIs(0) .autoHeightRatio(0); _titleLb.isAttributedContent = YES;

}

}