Ricky
Ricky

Reputation: 11

Flex Mobile: Can't position the component properly in titlecontent area of ActionBar

Things go weird when i tried position a button in titleContent of ActionBar. Set both the "left" and "horizontalCenter" can't move my button.Code as below:

    <s:titleContent>
       <s:Button label="HELLO" left="50"/>
    </s:titleContent>

How can I position a Button at the middle of this Actionbar??

Upvotes: 1

Views: 709

Answers (2)

xastor
xastor

Reputation: 482

You can also use css :

s|ActionBar 
{
    titleAlign: center;
}

Upvotes: 0

Sunil D.
Sunil D.

Reputation: 18193

The docs say that the default layout for the titleContent is HorizontalLayout. So 'left' and 'horizontalCenter' do not apply.

You can use the titleLayout property to use a different layout (BasicLayout) for the title content:

<s:titleLayout>
    <s:BasicLayout />
</s:titleLayout>

Upvotes: 1

Related Questions