Titanium 项目未显示在TableViewRow中
我在简单的钛书示例应用程序上创建了一个变体。 我将在连接的Nexus7上启动该应用程序。 应用程序启动,但不显示我的示例数据。 我看不出是什么导致它失败的 Index.xml如下所示:Titanium 项目未显示在TableViewRow中,titanium,titanium-alloy,Titanium,Titanium Alloy,我在简单的钛书示例应用程序上创建了一个变体。 我将在连接的Nexus7上启动该应用程序。 应用程序启动,但不显示我的示例数据。 我看不出是什么导致它失败的 Index.xml如下所示: <Alloy> <Collection src="item"/> <TabGroup> <Tab title="Items" icon="KS_nav_ui.png"> --> <Window c
<Alloy>
<Collection src="item"/>
<TabGroup>
<Tab title="Items" icon="KS_nav_ui.png"> -->
<Window class="container" title="Items">
<!-- Add TableView and TableViewRow -->
<TableView dataCollection="item">
<TableViewRow label="{label}" description="{description}" onClick="showItem"></TableViewRow>
</TableView>
<Menu id="menu" platform="android">
<MenuItem
title="Add book"
onClick="addBook"
showAsAction="Ti.Android.SHOW_AS_ACTION_IF_ROOM" />
</Menu>
</Window>
</Tab>
<Tab title="Admin" icon="KS_nav_views.png">
<Window title="Manage your listings">
<Label>Table of stuff to manage</Label>
</Window>
</Tab>
</TabGroup>
</Alloy>
item.js:
exports.definition = {
config: {
columns: {
"taken_by": "integer",
"taken_time": "integer",
"label": "text",
"creator": "integer",
"enabled": "integer",
"location": "integer",
"description": "text",
"created": "text",
"image": "text",
"price": "integer",
"currentPrice": "integer",
"topic": "integrer",
"deleted": "text"
},
adapter: {
idAttribute: "itemid",
type: "sql",
collection_name: "item"
}
},
extendModel: function(Model) {
_.extend(Model.prototype, {
// extended functions and properties go here
});
return Model;
},
extendCollection: function(Collection) {
_.extend(Collection.prototype, {
// extended functions and properties go here
});
return Collection;
}
};
我觉得一切都很好,编译时没有任何错误。有些警告似乎不相关,但它们是:
[WARN] : linker: libstlport_shared.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
[WARN] : linker: libtiverify.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
[WARN] : linker: libkroll-v8.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
[INFO] : TiApplication: (main) [308,465] Titanium Javascript runtime: v8
[INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
[WARN] : V8Object: (KrollRuntimeThread) [174,174] Runtime disposed, cannot set property 'userAgent'
它加载到nexus上,启动屏幕出现,然后应用程序开始时有两个选项卡,但是tab1中没有内容,我认为应该有一个项目标签和说明
有人有什么想法吗
谢谢好的,所以最后答案很简单。在Tianium教程中,他们有一个名为Favebooks的例子,书中有一个标题和作者 要在TableViewRow中显示标题,请在示例中执行以下操作
<TableViewRow title="{title}" author="{author}" onClick="showItem"></TableViewRow>
我为了自己的目的修改了这个。我有一个带有标签和描述的项目,将TableViewRow行更改为
<TableViewRow label="{label}" description="{description}" onClick="showItem"></TableViewRow>
但是,这不起作用,您需要
<TableViewRow title="{label}" description="{description}" onClick="showItem"></TableViewRow>
看来书名和TableViewRow书名是两码事。希望能帮助别人
<TableViewRow title="{label}" description="{description}" onClick="showItem"></TableViewRow>