gpt4 book ai didi

extjs - 右对齐面板内的按钮 ExtJS 5

转载 作者:行者123 更新时间:2023-12-01 07:18:31 25 4
gpt4 key购买 nike

我有一个面板设置为 HBOX。我里面有几个控件。一个标签、两个单选按钮和一个按钮。我希望标签和单选按钮左对齐,按钮右对齐。这是我到目前为止的代码。任何帮助都会很棒。谢谢。

{
xtype: 'panel',
layout: 'hbox',
border: false,
items: [
{ xtype: 'displayfield', value:'Type:', margin:'0 10 0 0' },
{ xtype:'radio', boxLabel : 'Type A', tag: null, margin:'0 10 0 0'},
{ xtype:'radio', boxLabel : 'Type B', tag:null, },
{ xtype: 'button', iconCls: 'myclsIcon'}
]
}

最佳答案

添加一个垫片组件(flex 1)来填充所有剩余空间:

{
xtype: 'panel',
layout: 'hbox',
border: false,
items: [{
xtype: 'displayfield',
value: 'Type:',
margin: '0 10 0 0'
}, {
xtype: 'radio',
boxLabel: 'Type A',
tag: null,
margin: '0 10 0 0'
}, {
xtype: 'radio',
boxLabel: 'Type B',
tag: null,
}, {
xtype: 'component',
flex: 1
}, {
xtype: 'button',
iconCls: 'myclsIcon'
}]
}

关于extjs - 右对齐面板内的按钮 ExtJS 5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28717120/

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