这里是 Sencha Touch 新手。也就是说,在过去一天左右的时间里,我一直在慢慢地思考这个问题。让我发疯的一件事是表单面板和列表由于某些奇怪的布局原因而没有显示。我不明白为什么。例如,我有以下搜索视图:
Ext.define('NC.view.Search', {
extend: 'Ext.dataview.List',
xtype: 'searchpage',
id: 'search-form',
config: {
title: 'Search',
layout: 'vbox',
itemTpl: '<div class="name">{name}</div>',
store: 'Recipes',
items: [
{
xtype: 'toolbar',
docked: 'top',
items: [
{ xtype: 'spacer' },
{
xtype: 'searchfield',
placeHolder: 'Search...'
},
{ xtype: 'spacer' }
]
}
]
}
})
它位于选项卡面板中:
Ext.define('NC.view.Recipes', {
extend: 'Ext.tab.Panel',
xtype: 'recipetabpanel',
config: {
title: 'Recipes',
tabBarPosition: 'bottom',
activeItem: 0,
items: [
{
title: 'Recipes',
iconCls: 'bookmarks',
items: [
{
xtype: 'searchpage'
}
]
},
{
title: 'Settings',
iconCls: 'settings',
html: 'Settings screen'
}
]
}
})
结果是一个可爱的渲染选项卡面板,顶部有一个停靠的搜索栏,但没有可见的列表项。如果我向列表面板添加一些尺寸:
width: '100%',
height: '200px',
将出现我的数据存储中的列表项。但我不能将高度设置为 100%,因为它会消失(我猜是 CSS 错误)。
那么,我需要什么样的布局层次结构或规范才能使列表显示并占据搜索栏和底部选项卡之间的区域?谢谢!