Search code examples
nativescript

How to align title text in ActionBar to the right instead of the default left?


I am creating an Arabic(RTL) app with NativeScript. I want the action bar to be sorted in rtl direction so the title is the right and menu options is to the left.

I tired using css and horizontalAlignment but nothing worked.

How can I achieve this?

Thank you.


Solution

  • Example

    <Page xmlns="http://schemas.nativescript.org/tns.xsd">
       <Page.ActionBar>
          <ActionBar >
             <Label text="TITLE"/>
         </ActionBar>
       </Page.ActionBar>
    </Page>
    

    And with css u can set to right side with or other styling of ActionBar

    ActionBar Label{
        text-align:right;
        horizontal-align:right;
    }
    

    Aligning title of ActionBar