mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-03 20:13:02 +08:00
fix(core): ellipsis at the end for Labels with maxLines (#10005)
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user