FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(uilabel): line height setter should not break line break mode by manoldonev · Pull Request #5544 · NativeScript/NativeScript · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .ts  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
8 changes: 8 additions & 0 deletions tns-core-modules/ui/text-base/text-base.ios.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ export class TextBase extends TextBaseCommon {
paragraphStyle.lineSpacing = this.lineHeight;
// make sure a possible previously set text alignment setting is not lost when line height is specified
paragraphStyle.alignment = (<UITextField | UITextView | UILabel>this.nativeViewProtected).textAlignment;
if (this.nativeViewProtected instanceof UILabel) {
// make sure a possible previously set line break mode is not lost when line height is specified
paragraphStyle.lineBreakMode = this.nativeViewProtected.lineBreakMode;
}
attrText.addAttributeValueRange(NSParagraphStyleAttributeName, paragraphStyle, { location: 0, length: attrText.length });
}

Expand Down Expand Up @@ -171,6 +175,10 @@ export class TextBase extends TextBaseCommon {
paragraphStyle.lineSpacing = style.lineHeight;
// make sure a possible previously set text alignment setting is not lost when line height is specified
paragraphStyle.alignment = (<UITextField | UITextView | UILabel>this.nativeViewProtected).textAlignment;
if (this.nativeViewProtected instanceof UILabel) {
// make sure a possible previously set line break mode is not lost when line height is specified
paragraphStyle.lineBreakMode = this.nativeViewProtected.lineBreakMode;
}
dict.set(NSParagraphStyleAttributeName, paragraphStyle);
}

Expand Down

Back | FazBrowse Home | New Git URL