我试着弄清楚为什么这个List不会出现在我在Sencha Touch中创建的导航视图中。只显示标题栏,其下方有一个空白屏幕。
var topView = Ext.define("Parks.view.Main", {
extend: "Ext.navigation.View",
fullscreen: true,
config: {
items: [
{
title: "Parks & Rec",
padding: 10,
items: [
{
xtype: "list",
fullscreen: true,
itemTpl: "{name}",
data: [{name: "Local Parks"}, {name: "Local Monuments"}],
listeners: {
select: function(view, record){
}
}
}
]
}
]
}
});
答案 0 :(得分:1)
您应该只在fullscreen
上使用Parks.view.Main
配置。要使list
组件适合父容器,您可以使用fit
布局:
Ext.define("Parks.view.Main", {
extend: "Ext.navigation.View",
fullscreen: true,
config: {
items: [
{
title: "Parks & Rec",
padding: 10,
layout: 'fit',
items: [
{
xtype: "list",
itemTpl: "{name}",
data: [{name: "Local Parks"}, {name: "Local Monuments"}],
listeners: {
select: function(view, record){
}
}
}
]
}
]
}
});
Ext.Viewport.add(Ext.create('Parks.view.Main'));