简体   繁体   English

使用ListActivity视图在android中创建表

[英]Using listactivity view to create table in android

I'm pretty new to android. 我是android新手。 I want to create a table in my Wapplication that will have three columns. 我想在Wapplication中创建一个包含三列的表。 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 ? 可以通过扩展ListActivity来实现吗? What is the best to way to create such a table in android ? 在android中创建此类表的最佳方法是什么?

Have you had a chance to go through the official NotePad tutorial ? 您是否有机会阅读NotePad官方教程 I am new to Android as well, and I would highly recommend it. 我也是Android的新手,因此强烈建议您使用。 It walks you through all the basics of creating a ListActivity with well documented code. 它带您逐步了解如何使用有据可查的代码创建ListActivity的所有基础知识。 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. 要创建“表”,您需要将练习1的步骤5中创建的布局(row_view.xml)从TextView更改为RelativeLayout。 Inside this RelativeLayout you would have a TextView for the string, an ImageView for the image, and another TextView for the integer. 在此RelativeLayout内部,您将有一个用于字符串的TextView,用于图像的ImageView和用于整数的另一个TextView。 Hope that helps you get started. 希望对您有所帮助。

Yeah, you probably want a ListView that contains rows with a custom layout. 是的,您可能想要一个ListView包含具有自定义布局的行。 There's an example here: http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/ 这里有一个示例: http : //www.softwarepassion.com/android-series-custom-listview-items-and-adapters/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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