【发布时间】:2017-04-06 01:33:38
【问题描述】:
它给了我一个未定义的标签错误,id="somethinggooood" 但是,如果我在 ListView 之外创建标签,它可以毫无问题地访问它
是否有任何解决方法或任何其他方法来解决它?
合金.XML
<ListView id="userList"
defaultItemTemplate="user"
onItemclick="userProfile" >
<Templates >
<ItemTemplate bindId="user" name="user" >
<View backgroundColor="red" layout="vertical">
<Label bindId="name" />
<Label bindId="title" id="somethinggooood" />
//THIS IS WHAT I'D LIKE TO ACCESS
<ImageView id="goodb" bindId="img" />
</View>
</ItemTemplate>
</Templates>
<ListSection id="section" dataCollection="users" >
<ListItem template="user"
user:id="{id}"
img:image="{author_img}"
name:text="{adresse}"
title:text="{title}" />
</ListSection>
</ListView>
JS
function goodfff(){
alert($.somethinggooood.text);
};
【问题讨论】:
标签: android listview data-binding titanium appcelerator