gsdios / SDAutoLayout

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

单行富文本label无法居中对齐,已经设置了label的minWidthIs,宽度并不生效

doubleJJJJ opened this issue · comments

布局代码如下:
label.sd_layout
.autoHeightRatio(0)
.leftSpaceToView(self.contentView, 34)
.topSpaceToView(titleLab, 35)
.rightSpaceToView(self.contentView, 34)
.minWidthIs(300);
我已经设置了minWidthIs,可是单行富文本label的宽度仍然是自适应,并且没有居中对齐,是哪里的问题呢?

我也遇到同样问题,设置 isAttributedContent = YES,单行富文本就不居中。不设置 isAttributedContent,单行富文本居中,但是多行计算高度有问题。

commented

跟yylabel 一起使用就会遇到很多问题