java 安卓表格视图
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4542655/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android table view
提问by Jony
I need to create a table layout similar to this http://sourceforge.net/dbimage.php?id=194965I need some example source code on how to do this.
我需要创建一个类似于http://sourceforge.net/dbimage.php?id=194965的表格布局 我需要一些关于如何执行此操作的示例源代码。
回答by ?ukasz Izmaj?owicz
Are you sure it is a TableLayout?? For me it looks like a ListView. If i'm wrong I'm curious how they remove elements from Table? I've looked to Documentation and don't find any method for removing elements. Maybe they generate then a new Table from beginning and replace old one? I really thing its a better way to use here a ListView, what do you thing ppl?
你确定它是一个 TableLayout?对我来说,它看起来像一个 ListView。如果我错了,我很好奇他们如何从表中删除元素?我查看了文档并没有找到任何删除元素的方法。也许他们从一开始就生成一个新表并替换旧表?我真的认为这是在此处使用 ListView 的更好方法,您对 ppl 有什么看法?
回答by Vinay Pai
There are many excellent examples for TableLayout and other views and layouts on the Android developers site:
在 Android 开发者网站上有许多关于 TableLayout 和其他视图和布局的优秀示例:
http://developer.android.com/resources/tutorials/views/index.html
http://developer.android.com/resources/tutorials/views/index.html
回答by Hans
Here's the basics of setting up an android gridview: http://developer.android.com/guide/tutorials/views/hello-gridview.html
这是设置 android gridview 的基础知识:http: //developer.android.com/guide/tutorials/views/hello-gridview.html
Obviously you'll need a little work to get to the desired result, but it's a good start from the standard android lib. This example places pictures in the grid, you'll want text or other stuff. That means tweaking the example. The gridview is not meant specifically for pictures, but in the example that's what its is used for. You'll have to bend that to text.
显然,您需要做一些工作才能获得所需的结果,但这是标准 android lib 的良好开端。此示例将图片放置在网格中,您将需要文本或其他内容。这意味着调整示例。gridview 并不是专门用于图片,但在示例中这就是它的用途。你必须把它变成文本。