mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(core): maxLines support for all text components (#9884)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { ScrollEventData } from '../scroll-view';
|
||||
import { textProperty } from '../text-base';
|
||||
import { TextViewBase as TextViewBaseCommon, maxLinesProperty } from './text-view-common';
|
||||
import { TextViewBase as TextViewBaseCommon } from './text-view-common';
|
||||
import { editableProperty, hintProperty, placeholderColorProperty, _updateCharactersInRangeReplacementString } from '../editable-text-base';
|
||||
import { CoreTypes } from '../../core-types';
|
||||
import { CSSType } from '../core/view';
|
||||
@@ -408,18 +408,6 @@ export class TextView extends TextViewBaseCommon {
|
||||
right: inset.right,
|
||||
};
|
||||
}
|
||||
[maxLinesProperty.getDefault](): number {
|
||||
return 0;
|
||||
}
|
||||
[maxLinesProperty.setNative](value: number) {
|
||||
this.nativeTextViewProtected.textContainer.maximumNumberOfLines = value;
|
||||
|
||||
if (value !== 0) {
|
||||
this.nativeTextViewProtected.textContainer.lineBreakMode = NSLineBreakMode.ByTruncatingTail;
|
||||
} else {
|
||||
this.nativeTextViewProtected.textContainer.lineBreakMode = NSLineBreakMode.ByWordWrapping;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TextView.prototype.recycleNativeView = 'auto';
|
||||
|
||||
Reference in New Issue
Block a user