表列的Android的动态数 [英] table with dynamic number of columns android
问题描述
我想创建一个与Android的列数动态表我知道如何添加动态使用LayoutInflator行,但如何添加动态列?
I want to create a table with dynamic number of columns in android I know how to add rows dynamically using LayoutInflator but how to add columns dynamically?
感谢您的宝贵时间任何帮助是高度appriciated
Thank you for your time any help is highly appriciated
推荐答案
在不添加列 - 只有行,之后你可以告诉每个视图中有多少列需要跨越
you dont add columns - only rows and after that you can tell every view how many columns need to span
android:layout_span
Defines how many columns this child should span. Must be >= 1.
Must be an integer value, such as "100".
This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type.
This corresponds to the global attribute resource symbol layout_span.
<一个href=\"http://developer.android.com/reference/android/widget/TableRow.LayoutParams.html#attr_android:layout_span\" rel=\"nofollow\">http://developer.android.com/reference/android/widget/TableRow.LayoutParams.html#attr_android:layout_span
最好的TUTS之一: http://mobile.tutsplus.com /教程/安卓/ Android的sdk_table布局/
one of the best Tuts: http://mobile.tutsplus.com/tutorials/android/android-sdk_table-layout/
这篇关于表列的Android的动态数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!