javascript - 无法使用 sencha 在屏幕底部的面板中显示 2*2 按钮以及屏幕顶部的轮播

标签 javascript html sencha-touch extjs

我正在尝试在 sencha touch 中创建一个具有以下设计的页面。

我用下面的代码让它看起来像

enter image description here


代码片段

entwoven.views.vehicleSelectionToolBar = new Ext.Toolbar({
    //Code for toolbar
});

//  **Carousel Started
// ** first carPanel1 - Added 2 pics to view in the visible area

entwoven.views.carPanel1 = new Ext.Panel({
    id: 'carPanel1',
    layout: 'hbox',
    items: [{
        xtype: 'button',
        id: 'beetelbtnId',
        cls: 'beetelbtn',

    }, {
        xtype: 'button',
        id: 'emobbtnId',
        cls: 'emobbtn',
        handler: function() {
            entwoven.views.viewport.setActiveItem('modusaPanel', {
                type: 'slide',
                direction: 'left'
            });
        }

    }]
});

entwoven.views.carPanel2 = new Ext.Panel({
    id: 'carPanel2',
    layout: 'hbox',
    items: [{
        // Same Code as above
    }]

});

entwoven.views.carCarousel = new Ext.Carousel({
    id: 'carCarousel',
    cls: 'carCarousel',

    defaults: {
        cls: 'card'
    },
    items: [entwoven.views.carPanel1, entwoven.views.carPanel2]
});


// Carousel ended//

// Bottom part 2 * 2 buttons started // 
entwoven.views.carhomePanel1 = new Ext.Panel({
    id: 'carhomePanel1',
    layout: 'hbox',
    items: [{
        xtype: 'button',
        id: 'vehiclebtn',

    }]
});

entwoven.views.carhomePanel2 = new Ext.Panel({
    // Same code as above panel with different id and cls
});


entwoven.views.carhomePanel3 = new Ext.Panel({
    // Same code as above panel with different id and cls
});

entwoven.views.carhomePanel4 = new Ext.Panel({
    // Same code as above panel with different id and cls
});

entwoven.views.horizontalPanel1 = new Ext.Panel({
    id: 'horizontalPanel1',
    layout: 'hbox',
    items: [entwoven.views.carhomePanel1, entwoven.views.carhomePanel2]

});

entwoven.views.horizontalPanel2 = new Ext.Panel({
    id: 'horizontalPanel2',
    layout: 'hbox',
    items: [entwoven.views.carhomePanel3, entwoven.views.carhomePanel4]

});

entwoven.views.staticPanel = new Ext.Panel({
    id: 'staticPanel',
    //fullscreen:true,
    layout: 'vbox',
    cls: 'panelBackground',
    items: [entwoven.views.horizontalPanel1, entwoven.views.horizontalPanel2]
});

//  Bottom part 2 * 2 buttons started // 


entwoven.views.vehicleSelectionPanel = new Ext.Panel({
    id: 'vehicleSelectionPanel',
    fullscreen: true,
    cls: 'panelBackground',
    layout: {
        type: 'vbox',
        align: 'stretch'
    },
    defaults: {
        flex: 2
    },
    dockedItems: entwoven.views.vehicleSelectionToolBar,
    items: [entwoven.views.carCarousel, entwoven.views.staticPanel]
});

当我试图在谷歌浏览器上运行它时,我无法在可见区域看到底部。

当我检查元素时,它没有显示添加到面板的 horizo​​ntalPanel1 和 horizo​​ntalPanel2。

如果我尝试单独渲染底部面板,效果会很好。 我尝试了所有可能的方法,但无法找到解决方案。

请帮忙。

谢谢

最佳答案

将面板添加为具有 vbox 布局的旋转木马项目,并在具有 hbox 布局的父面板中添加两个面板,并使用 flex:1 将按钮放入这些拖曳子面板中

关于javascript - 无法使用 sencha 在屏幕底部的面板中显示 2*2 按钮以及屏幕顶部的轮播,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10617674/

相关文章:

javascript - 语言检测和 url 重写/重定向

html - 建立新的基于框架的元素并使用 LESS

javascript - 从中心缩放后将元素保持在原始位置

html - 我没有添加的 IE8 中奇怪的边框线

filter - Sencha Touch 过滤器 ListView 数据存储

javascript - 转换由 | 分隔的时间戳列表(管道) 到 Sencha Touch 2 中的日期选择下拉菜单中

Javascript:网页上的调光效果

javascript - 即使 Angular JS 中的必填字段留空,表单也会被提交

javascript - 如何在语义 UI vue 下拉列表中使用动态键传递数据?

javascript - 将 json 数据添加到 Sencha Touch 中的 selectfield