开发者

Custom Item in ListActivity on Android

开发者 https://www.devze.com 2022-12-29 19:14 出处:网络
I\'ve spent hours reading through the SDK reference, googling and reading tutorials - but I still can\'t figure it out.

I've spent hours reading through the SDK reference, googling and reading tutorials - but I still can't figure it out.

I would like to know how to create a custom list item in the ListActivity widget on Android. Something similar to a Twitter client interface. Each list item has different types of text, possibly an icon, etc.

The issue is binding the data to the list item. If you define your own data structure, let's say "Tweet" which will store the message, author, date se开发者_JAVA百科nt and a picture URL - how do you bind the tweet instance to the custom list item?

Does anyone know of any resources that would help me understand the process of creating something like that?

Any guidance would be appreciated. Thanks


I'm not sure which tutorials you were reading but it's quite simple. You define your layout. You use it in your getView for your items. http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html

you can also look at Mark's example with lazy loading images http://github.com/commonsguy/cwac-thumbnail

0

精彩评论

暂无评论...
验证码 换一张
取 消