Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JPIOS opened this issue Dec 7, 2020 · 0 comments

Comments

@JPIOS
Copy link

JPIOS commented Dec 7, 2020

代码布局如下:

-(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;

}

  • (void)setCellModel:(GSOrderDetailTrackCellViewModel *)cellModel {
    [super setCellModel:cellModel];

    _titleLb.attributedText = cellModel.attrTitleValue;
    _titleLb.isAttributedContent = YES;
    [self setupAutoHeightWithBottomView:_titleLb bottomMargin:cellModel.contentEdge.bottom];

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant