gpt4 book ai didi

javascript - Sencha 触摸 : How to center align two buttons in bottom docked toolbar?

转载 作者:行者123 更新时间:2023-12-03 18:53:33 25 4
gpt4 key购买 nike

我想知道如何将底部停靠工具栏中的两个按钮居中对齐。我在按钮上看到的唯一解决这个问题的属性是 centered 但它使按钮绝对重叠在按钮的中心,有没有办法将它们分组在中心?

这是我一直在使用的一些代码:http://www.senchafiddle.com/#xTZZg#k24Ni

Ext.Loader.setConfig({
enabled: true
});

Ext.application({
name: 'SenchaFiddle',

launch: function () {

var panelNewForm = Ext.create('Ext.Panel', {
id: 'panelNewForm',
title: 'TEST',
html: 'TEST',
pack: 'center',
items: [{
xtype: 'toolbar',
docked: 'bottom',
layout: {
type: 'hbox',
align: 'center'
},
items: [{
ui: 'decline',
text: 'Cancel',
handler: function () {

}
}, {
ui: 'confirm',
text: 'Save',
handler: function () {

}
}]
}]
});
Ext.Viewport.add(panelNewForm);
}
});

最佳答案

你可以给你的工具栏一个layout配置:

layout: {
pack: 'center',
type: 'hbox'
}

这会将您的项目水平呈现在此工具栏的中心。

关于javascript - Sencha 触摸 : How to center align two buttons in bottom docked toolbar?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14814772/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com