Martin Vandzura
Martin Vandzura

Reputation: 3127

Button width - wrap content (Sencha touch 2)

How can I set button width to wrap content? Default html button wraps content, but default sencha button use all width of parent. Next question. If button width wraps content, how to align button?

Thanks

Upvotes: 1

Views: 2523

Answers (1)

Thiem Nguyen
Thiem Nguyen

Reputation: 6365

As far as I know, there is no Ext.Button config like textWrap: true in Sencha Touch 2. But you can try a work-around. Normally you can use width and height config to set absolute size of the button, and minWidth, maxWidth or minHeight, maxHeight for the lowerbound and upperbound of width and height, you should combine them with CSS styles of your text.

About alignment: Ext.Button is just like other Ext components, if it belongs to a parent container, then the config centered:true should align it to the center of the parent container.

Upvotes: 2

Related Questions