用deviceone开发的App的时候,用到了listview那个组件,看了下文档,绑定了数据,现在我想绑定多个模板,如何绑定?这个是绑定一个模板。
do_ListView_data.addData([
{ template : 0,Name : "1", Brief : 1",Image : "source://image/1.jpg" },
{ template : 0,Name : "2", Brief : "2",Image : "source://image/2.png" }
]);
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
你说的意思是两行显示的不一样嘛?
你先要建两个模板,就是两个cell,然后绑定的时候绑定两个。
你看下这个template ,一个是0,一个是1
绑定多个模板,就是按顺序绑定就可以了。
ListView支持多种ViewType,你可以参考下这个链接:http://stackoverflow.com/questions/4777272/android-listview-with-different-layout-for-each-row