fix(core): ellipsis at the end for Labels with maxLines (#10005)

This commit is contained in:
felixkrautschuk
2022-11-18 19:29:05 +01:00
committed by GitHub
parent b998d40a54
commit 6c60eab870
5 changed files with 68 additions and 1 deletions

View File

@ -468,6 +468,7 @@ export class TextBase extends TextBaseCommon {
nativeTextViewProtected.setMaxLines(Number.MAX_SAFE_INTEGER);
} else {
nativeTextViewProtected.setMaxLines(typeof value === 'string' ? parseInt(value, 10) : value);
nativeTextViewProtected.setEllipsize(android.text.TextUtils.TruncateAt.END);
}
}

View File

@ -244,6 +244,7 @@ export class TextBase extends TextBaseCommon {
}
} else if (nativeTextViewProtected instanceof UILabel) {
nativeTextViewProtected.numberOfLines = numberOfLines;
nativeTextViewProtected.lineBreakMode = NSLineBreakMode.ByTruncatingTail;
} else if (nativeTextViewProtected instanceof UIButton) {
nativeTextViewProtected.titleLabel.numberOfLines = numberOfLines;
}