簡體   English   中英

Sencha Touch 2:帶按鈕的消息框:如何垂直對齊按鈕?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM