gpt4 book ai didi

java - SenchaTouch ListView 在视口(viewport)中?

转载 作者:太空宇宙 更新时间:2023-11-04 08:32:22 25 4
gpt4 key购买 nike

在过去的几个小时里,我一直在努力弄清楚如何让它发挥作用,但我很挣扎。

我目前正在尝试制作一个具有四个选项卡按钮的应用程序,每个选项卡按钮都有自己的视口(viewport)js文件,这工作正常,但是在其中一个 View 上我需要显示 ListView 。

这就是我目前所拥有的,

MobileApp.views.Settings_screen = Ext.extend(Ext.List, {

title: "Settings ",
iconCls: "settings",
layout: 'fit',


initComponent: function() {

MobileApp.listPanel = new Ext.List({
id: 'indexlist',
store: MobileApp.listStore,
itemTpl: 'div class="contact">{firstName} {lastName}</div>'
});
},

items: [MobileApp.listPanel],
});

Ext.reg('settings_screen', MobileApp.views.Settings_screen);

但是,当我运行应用程序并单击设置选项卡栏按钮时,屏幕上没有显示任何内容。

任何帮助将不胜感激。

谢谢亚伦

最佳答案

我只能对您发布的代码进行评论,因此我无法告诉您您的选项卡栏是否有问题 - 但是这个 Settings_screen 有一些问题...

如果您要包含自己的 initComponent 函数,则需要从您的 initComponent 函数中调用其父类(super class)的 initComponent 函数...就像您的情况一样......

initComponent: function() {
MobileApp.views.Settings_screen.superclass.initComponent.call(this);
}

另一个问题是您在 initComponent 函数内创建 MobileApp.listPanel,因此您无法像您尝试的那样将其包含在 items 数组中...而是一起删除 items 属性,并在创建后在 initComponent 函数中使用 this.add(MobileApp.listPanel)

您还需要更改Settings_screen以扩展Ext.Panel,您不向List组件添加List组件,您需要有一个容器..无论是另一个面板还是您的视口(viewport)容器的主体..

这些更改是否足以使其正常工作将取决于您未发布的代码是否存在问题。

关于java - SenchaTouch ListView 在视口(viewport)中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7232514/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com