代码之家  ›  专栏  ›  技术社区  ›  Dmitry

如何使用单元格填充GridView的全宽和高android:弹性模式=“列宽”?

  •  0
  • Dmitry  · 技术社区  · 8 年前

    我想创建具有不同(但相似)宽度和高度的网格单元,以便它们覆盖父视图的全部可用区域。例如:

    parent width is 33
    grid cells: width 10, width 10, width 13
    

    enter image description here

    的XML代码 GridView

    <GridView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/calendar_gridview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:numColumns="7"
        android:stretchMode="columnWidth"
        style="?styleCaldroidGridView" />
    

    偶数 android:gravity="center" android:scaleType="fitXY" 不要把工作当作变通办法。

    P、 我正在努力解决这个问题 Caldroid

    0 回复  |  直到 8 年前
    推荐文章