【发布时间】:2015-06-24 22:02:50
【问题描述】:
我在这个问题上需要帮助,我在 appcelerator studio 上有一个这样的列表视图:
<ListView id="lvPropuestas" defaultItemTemplate="plantilla">
<Templates>
<ItemTemplate name="plantilla">
<Label bindId="bindGarantia" class="columnG columnContentStyle"></Label>
<Label bindId="bindPropuesta" class="columnProp columnContentStyle"></Label>
<Label bindId="bindMonto" class="columnM columnContentStyle"></Label>
<Label bindId="bindPrima" class="columnPrim columnContentStyle"></Label>
<Button bindId="btnNavega" class="btnTabla" onClick="DetallePropuesta">></Button>
<!--
-->
</ItemTemplate>
</Templates>
<HeaderView>
<View backgroundColor="#E2DBD3" height="35dip">
<Label id="headerG" class="titleStyle">GARANTIA</Label>
<Label id="headerProp" class="titleStyle">PROPUESTAS</Label>
<!--
-->
<Label id="headerM" class="titleStyle">MONTO</Label>
<Label id="headerPrim" class="titleStyle">PRIMA</Label>
</View>
</HeaderView>
<ListSection>
</ListSection>
</ListView>
本节更新了网络服务调用*,所以在我的 js 中我声明了一个事件监听器,如下所示:
$.lvPropuestas.addEventListener('itemclick',seleccionFila);
最后我的函数是这样的:
function seleccionFila(e){
var item = e.section.getItemAt(e.itemIndex);
item.properties.color ='#33CCCC';
e.section.updateItemAt(e.itemIndex, item); }
我试图更改列表项的背景颜色,但在单击的那一刻,我捕捉到了该项目,但在来自 appcelerator 的文档中,他们“更改”了一些属性,例如完整行的背景颜色,但是,这样会提高属性错误不是对象,有帮助吗?
【问题讨论】:
标签: android ios titanium appcelerator appcelerator-mobile