mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-14 18:12:09 +08:00
fix(android): Label now defaults to vertical-align middle (#10233)
closes https://github.com/NativeScript/NativeScript/issues/3829 https://github.com/NativeScript/NativeScript/issues/5977 https://github.com/NativeScript/NativeScript/pull/8216
This commit is contained in:
@ -5,7 +5,16 @@
|
|||||||
</Page.actionBar>
|
</Page.actionBar>
|
||||||
<ScrollView>
|
<ScrollView>
|
||||||
<StackLayout padding="20">
|
<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
|
<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."
|
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"
|
textWrap="true"
|
||||||
|
@ -39,6 +39,7 @@ export class Label extends TextBase implements LabelDefinition {
|
|||||||
const textView = this.nativeTextViewProtected;
|
const textView = this.nativeTextViewProtected;
|
||||||
textView.setSingleLine(true);
|
textView.setSingleLine(true);
|
||||||
textView.setEllipsize(android.text.TextUtils.TruncateAt.END);
|
textView.setEllipsize(android.text.TextUtils.TruncateAt.END);
|
||||||
|
textView.setGravity(android.view.Gravity.CENTER_VERTICAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
[whiteSpaceProperty.setNative](value: CoreTypes.WhiteSpaceType) {
|
[whiteSpaceProperty.setNative](value: CoreTypes.WhiteSpaceType) {
|
||||||
|
Reference in New Issue
Block a user