简体   繁体   中英

Using listactivity view to create table in android

I'm pretty new to android. I want to create a table in my Wapplication that will have three columns. Once column would have string, another would have a image and last column would have a integer. Again, I want to have table rows selectable. Can this be achieved by extending ListActivity ? What is the best to way to create such a table in android ?

Have you had a chance to go through the official NotePad tutorial ? I am new to Android as well, and I would highly recommend it. It walks you through all the basics of creating a ListActivity with well documented code. To create your "table" you would change the layout (row_view.xml), created in Step 5 of Exercise 1, from a TextView to a RelativeLayout. Inside this RelativeLayout you would have a TextView for the string, an ImageView for the image, and another TextView for the integer. Hope that helps you get started.

Yeah, you probably want a ListView that contains rows with a custom layout. There's an example here: http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM