同一行中的按钮 [英] Buttons in a same row

查看:87
本文介绍了同一行中的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我用sencha touch编写的代码,我试图在水平方向添加2个按钮,表示一个按钮到另一个按钮.

Here my code in sencha touch, i tried to add 2 button horizontaly, Means one to other.No,luck its keep on coming one in upper side and the other one lower.

 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'});
                    }
                    }]
                };

如何在同一行中设置按钮.请帮助我进行排序.

How to set button in a same row.Please help me to sort it out.

推荐答案

我不确定代码中的tab是什么,但是将按钮水平对齐需要的是hbox布局:

I'm not sure what tab is in your code, but what you need to get the buttons aligned horizontally is an hbox layout:

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

这篇关于同一行中的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆