【问题标题】:resize all images in gridview to fit the 3x5调整gridview中所有图像的大小以适应3x5
【发布时间】:2012-06-24 10:19:06
【问题描述】:

我有一个包含 3 列和 5 行图像的 GridView。

当前配置...

<GridView
    android:id="@+id/faces_gridview"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:numColumns="3" >
</GridView>

我希望里面的图像调整自己的大小以适应每部手机不同的 3x5 网格。如何告诉 GridView 根据我想要的网格大小调整图像大小?

numColumns 设置列,但它不能让我放心,屏幕上会有 5 行可见。我不想使用滚动条。

【问题讨论】:

  • 用于图像视图 android:scaleType="fitXY".

标签: java android android-layout android-gridview


【解决方案1】:

根据GridView auto fit images & GridView not stretching to all screens

试试

android:scaleType="fitXY" in image view 

and

 android:stretchMode="columnWidth" in grid view

【讨论】:

猜你喜欢
  • 2014-05-05
  • 2012-09-15
  • 1970-01-01
  • 2011-02-03
  • 2020-06-03
  • 2011-04-17
  • 1970-01-01
  • 2015-07-16
相关资源
最近更新 更多