如何使一个GridView拉伸的Android的拓展列宽以任何延长? [英] How to make a GridView stretchable in Android to expand the Column width to any extend?
问题描述
请人帮助我做一些code片段上悬而未决的问题。如果有人知道如何使一个可调节的GridView请帮助我。
Anyone please help me with some code snippets to slove the problem.If anyone knows how to make an adjustable gridview please help me.
推荐答案
如果您已设置列的具体数目和希望列在必要时扩展,尝试<一href="http://developer.android.com/reference/android/widget/GridView.html#setStretchMode%28int%29"><$c$c>gridView.setStretchMode(GridView.STRETCH_COLUMN_WIDTH)$c$c>.
If you've set a specific number of columns and want the columns to expand as necessary, try gridView.setStretchMode(GridView.STRETCH_COLUMN_WIDTH)
.
如果你不是设置一个特定的列宽和所需的列数根据需要改变,使用<一个href="http://developer.android.com/reference/android/widget/GridView.html#setNumColumns%28int%29"><$c$c>gridView.setNumColumns(GridView.AUTO_FIT)$c$c>.
If you've instead set a specific column width and want the number of columns to change as necessary, use gridView.setNumColumns(GridView.AUTO_FIT)
.
这篇关于如何使一个GridView拉伸的Android的拓展列宽以任何延长?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!