[英]Sencha Touch: How to center align two buttons in bottom docked toolbar?
[英]Sencha Touch 2: Message box with buttons: How to align buttons vertically?
這是正常工作的代碼。
Ext.Msg.show({
title: 'The title',
message: 'and some text...',
scope: this,
buttons : [
{
itemId : 'no',
text : 'Top button'
},
{
itemId : 'yes',
text : 'Bottom button'
}
],
fn: function(btn) {
if (btn == 'yes'){
//do something
}
}
});
如何垂直對齊按鈕? 默認情況下,它們水平行進。
如果您的Ext.Msg.Show
只有兩個按鈕,則可以使用' docked '屬性獲得所需的結果。 (像這樣):
祝好運!
這是更新的代碼:
Ext.Msg.show({
title: 'The title',
message: 'and some text...',
scope: this,
buttons : [
{
docked: 'top',
itemId : 'no',
id: 'no',
text : 'Top button'
},
{
docked: 'bottom',
itemId : 'yes',
id : 'yes',
text : 'Bottom button'
}
],
fn: function(btn) {
if (btn == 'yes'){
//do something
}
}
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.