0

タブパネルにリスト項目があります。ブラウズ リスト ページにヘッダー バーが表示されない。誰かが解決策を持っている場合は、私に知らせてください。前もって感謝します。

Main.js

Ext.define('myapp.view.Main', { extend: 'Ext.tab.Panel', xtype: 'main', requires: [ 'Ext.TitleBar', 'Ext.Video', 'myapp.view.Browse' ], config: { tabBarPosition: 'bottom', items: [{ xtype: 'browseView', title: 'Blog', iconCls: 'star' } ] } });

Browse.js

Ext.define('myapp.view.Browse', {    extend: "Ext.Container",
xtype: "browseView",
id: 'browseView',
requires: ["Ext.dataview.List", "myapp.view.Header"],
config: {
    layout: {
        type: 'fit' //set containers layout
    },
    items: [{
        xtype: "headerview"
    }, {
        store: "Browse",
        xtype: 'list', //add xtype
        onItemDisclosure: false,
        itemTpl: [
            '<img src="{Image_path}" width="80" height="90" style="float:left; margin-right:10px;" /><h4 style="color:blue;">{Name}</h4><p>{Description}</p><div style="clear: both"></div>'
        ]
    }]
} });

Header.js

Ext.define('myapp.view.Header', {
extend: 'Ext.Panel',
xtype: "headerview",
config: {
    height: '60',
    layout: {
        type: 'hbox',
        align: 'stretch'
    },
    defaults: {
        flex: '1'
    },
    style: 'text-align:left;width: 100%',
    items: [{
        html: '<div class="header_bg"><img src="img/logo.png" alt="logo"/></div>'
    }]
} });
4

1 に答える 1

0

ノート

1) 2 つのアイテムの場合、hbox / vbox を使用する必要があります。fit は単一のアイテムを意味し、その単一は画面全体のサイズを占めます。

2) browseView 内の 2 つのアイテムの高さを指定します。

だからあなたのbrowseViewコード

Ext.define('Rest.view.Browse',{  
extend: "Ext.Container",
xtype: "browseView",
id: 'browseView',
requires: ["Ext.dataview.List", "Rest.view.Header"],
config: {
    items: [{
        xtype: "headerview",
        height : '40%'
    }, {
        store: "Browse",
        height : '60%',
        xtype: 'list', //add xtype
        onItemDisclosure: false,
        itemTpl: [
            '<img src="{Image_path}" width="80" height="90" style="float:left; margin-right:10px;" /><h4 style="color:blue;">{Name}</h4><p>{Description}</p><div style="clear: both"></div>'
        ]
    }]
} 
});
于 2013-09-25T16:45:32.500 に答える