これは簡単な質問ですが、私は答えを得ることができません。 デバイスの画面に応じて、グリッドイメージのサイズを変更します。android:gridview画面に常に収まるようにグリッドサイズを定義する方法
私は私のGridViewのは
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="#111111">
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridview" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:verticalSpacing="10dip"
android:horizontalSpacing="10dp" android:numColumns="auto_fit"
android:stretchMode="columnWidth" android:listSelector="@null"
android:layout_below="@+id/text1view" android:layout_marginTop="10dip"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
/>
</RelativeLayout>
として定義されているとアダプタで私がやっている:あなたの時間との答えのための
imageView = new ImageView(mContext);
// imageView.setImageResource(mThumbIds[position]);
imageView.setLayoutParams(new GridView.LayoutParams(150, 150));
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
imageView.setOnClickListener(new View.OnClickListener() {`
おかげで多くのことを。
はありがとう、私たちはディップの値をハードコーディングするよりも、いくつかのキーワードを使用することができます方法はあり – png