Skip to content

在中文显示下是正常的,在其他语言下右边会有一块空白,这个怎么优化, #359

Description

@x-lark
    self.leftLabel.sd_layout
        .leftSpaceToView(self, 0)
        .centerYEqualToView(self)
        .autoHeightRatio(0);

self.leftLabel.font = kFontSize_17;
self.leftLabel.textColor = kColorHex(kColorBlack);
self.leftLabel.text = kFRFGetStringWithKey(@"Func_275"); // 密码
[self.leftLabel setMaxNumberOfLinesToShow:2];
[self.leftLabel setSingleLineAutoResizeWithMaxWidth:kScale_Space(120)];

在中文显示下是正常的,在其他语言下右边会有一块空白(如图一)。

如果加上下面这行代码,换行显示也能正常,但是单行文本又不会居中显示了,会偏上显示,与其他的文本有不能对齐显示(如图二)
self.leftLabel.isAttributedContent = YES;

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions