PeterStaev / NativeScript-Drop-Down

A NativeScript DropDown widget.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a way to align the selected item to the right?

Jamiek94 opened this issue · comments

commented

Is it possible to only align the selected item to the right on android? It seems to be aligned to the left. I've tried several CSS styles like text-align & horizontal-align, but without success.

image

You could try textAlignment attribute DropDown textAlignment="right" .
For more information, the container used to set your text ui is a Label so use one of the TextAlignment valid alignment https://docs.nativescript.org/api-reference/classes/ui_label.label#textalignment

commented

The textAlignment didn't work for me. I had to set the gravity;

 const dropdown = this.page.getViewById<DropDown>("countryId");
 dropdown.nativeView.setGravity(8388613); // means gravity END.