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

fix(android): default Label to vertical-align middle by NathanWalker · Pull Request #10233 · NativeScript/NativeScript · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .ts  (1) .xml  (1) All 2 file types 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
11 changes: 10 additions & 1 deletion apps/toolbox/src/pages/labels.xml
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 @@ -5,7 +5,16 @@
</Page.actionBar>
<ScrollView>
<StackLayout padding="20">
<Label text="maxLines 2" fontWeight="bold" />
<GridLayout borderWidth="1" borderColor="#efefef" height="60" paddingLeft="5">
<Label text="Test Label 1: should be aligned middle" />
</GridLayout>
<GridLayout marginTop="10" borderWidth="1" borderColor="#efefef" height="60" paddingLeft="5">
<Label text="Test Label 2: should be aligned bottom" verticalAlignment="bottom" />
</GridLayout>
<GridLayout marginTop="10" borderWidth="1" borderColor="#efefef" height="60" paddingLeft="5">
<Label text="Test Label 3: should be aligned top" verticalAlignment="top" />
</GridLayout>
<Label text="maxLines 2" fontWeight="bold" marginTop="10" />
<Label
text="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
textWrap="true"
Expand Down
1 change: 1 addition & 0 deletions packages/core/ui/label/index.android.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 @@ -39,6 +39,7 @@ export class Label extends TextBase implements LabelDefinition {
const textView = this.nativeTextViewProtected;
textView.setSingleLine(true);
textView.setEllipsize(android.text.TextUtils.TruncateAt.END);
textView.setGravity(android.view.Gravity.CENTER_VERTICAL);
}

[whiteSpaceProperty.setNative](value: CoreTypes.WhiteSpaceType) {
Expand Down

Back | FazBrowse Home | New Git URL