mgreer
23 Dec 2011, 1:40 PM
In Sencha Touch 1.1, this was easy to do by using a spacer
{
xtype: 'toolbar',
title: 'my toolbar',
items: [
{ ui: 'back', text: 'Back' },
{ xtype: 'spacer' },
{ ui: 'forward', text: 'Forward' }
]
}
In 1.1, it seemed like the toolbar's title did not get in the way of any of this, it "did the right thing".
The same configuration in Sencha Touch 2 (Pre3) does not work. In ST2, the title is just another item in the toolbar, so you end up with this:
30279
I realize ST2 is not done and this probably hasn't been addressed yet, but in the mean time anyone have a reliable hack to accomplish this? Simply doing
button, spacer, title, spacer, button
and then having all setTitle calls go to this added title does work. But only if I will always have two buttons. Sometimes I just want a button on the right.
{
xtype: 'toolbar',
title: 'my toolbar',
items: [
{ ui: 'back', text: 'Back' },
{ xtype: 'spacer' },
{ ui: 'forward', text: 'Forward' }
]
}
In 1.1, it seemed like the toolbar's title did not get in the way of any of this, it "did the right thing".
The same configuration in Sencha Touch 2 (Pre3) does not work. In ST2, the title is just another item in the toolbar, so you end up with this:
30279
I realize ST2 is not done and this probably hasn't been addressed yet, but in the mean time anyone have a reliable hack to accomplish this? Simply doing
button, spacer, title, spacer, button
and then having all setTitle calls go to this added title does work. But only if I will always have two buttons. Sometimes I just want a button on the right.