在这里,我的代码在感官触摸,我试图添加2个按钮水平,意味着一个到other.No,运气它不断来,一个在上边,另一个较低。
var profilese = {
standardSubmit : false,
items: [tab,{
xtype: 'button',
text: 'ADD',
ui: 'confirm',
handler: function() {
view.setActiveItem(2, {type:'fade', direction:'right'});
}
},{
xtype: 'DELETE',
text: 'Search Friends',
ui: 'Search',
handler: function() {
view.setActiveItem(3, {type:'fade', direction:'right'});
}
}]
};如何在同一个row.Please中设置按钮,可以帮助我解决这个问题。
发布于 2013-08-23 12:28:36
我不确定tab在代码中是什么,但是要使按钮水平地对齐,需要的是hbox布局:
layout: 'hbox',
items: [
{
xtype: 'button',
text: 'ADD',
ui: 'confirm',
handler: function() {
view.setActiveItem(2, {type:'fade', direction:'right'});
}
},{
xtype: 'button',
text: 'Search Friends',
ui: 'Search',
handler: function() {
view.setActiveItem(3, {type:'fade', direction:'right'});
}
}
]http://docs.sencha.com/touch/2.2.1/#!/api/Ext.layout.HBox
发布于 2013-08-23 12:29:37
在ExtJS点中,必须有一个容器作为父容器来容纳子容器(按钮)。并将布局配置设置为"hbox“。
代码必须看起来像,
items:[
tab,
{
xtype:'container',
layout:'hbox',
items:[
{
xtype:'button1'
},
{
xtype:'button2'
}
]
}
]发布于 2013-08-23 19:49:49
layout: {
type: 'column'
},
items: [
{
xtype: 'button',
columnWidth: 0.5,
text: 'ADD',
ui: 'confirm',
handler: function() {
view.setActiveItem(2, {type:'fade', direction:'right'});
}
},{
xtype: 'button',
columnWidth: 0.5,
text: 'Search Friends',
ui: 'Search',
handler: function() {
view.setActiveItem(3, {type:'fade', direction:'right'});
}
}
]https://stackoverflow.com/questions/18401887
复制相似问题