Skip to content

[TNS 3] Wrapped text in Button not properly centered (iOS) #4266

@toddanglin

Description

@toddanglin

There seems to be a regression with the way wrapped text is centered in a NativeScript button on iOS.

Pre-TNS3, if you set style="text-align:center;" on a Button with textWrap="true", the text would be both A) centered in the Button, and B) any wrapped text would be centered on the new wrapped line.

With TNS3 (confirmed in 3.0.1 on iOS), those same style settings will center the text in the Button, BUT wrapped text on new lines will not be centered. Instead, wrapped text is left aligned.

The problem should be easy to reproduce using any button with style settings that cause the text to wrap. For example:

<Button text="This is a test of a Button text wrapping" textWrap="true" style="text-align:center;width:100;" />

Does not apply to Android or Label widgets. Text is properly centered when wrapped.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions