Skip to content

Inconsistency between Android and iOS in label rendering (vertical center) #5977

@Burgov

Description

@Burgov

Did you verify this is a real problem by searching the NativeScript Forum and the other open issues in this repo?

Yes

Tell us about the problem

Labels render differently in iOS than in Android. In iOS, the text inside is vertically centered, in Android it's top aligned.

Which platform(s) does your issue occur on?

Both

Please provide the following version numbers that your issue occurs with:

See playground

Please tell us how to recreate the issue in as much detail as possible.

https://play.nativescript.org/?template=play-ng&id=GXFhEd&v=2

The above Label has no logic applied to it. You can see that in iOS, the text is vertically centered, while in Android, it's top aligned.

The 2nd span has the following logic applied to force it to be vertically centered:

                el.android.setGravity(el.android.getGravity() & 0xffffffdf);

This should be standard behavior in android to make the behavior consistent between the two platforms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions