2
2列のグリッドビューと自動サイズ変更画像
2列のグリッドビューを作成しようとしています。この画像のように、1行に2枚の写真を並べて並べます。 しかし、私の写真は同じサイズではないため、それらの間にスペースがあります。これが私が手に入れているものです。 最初の写真を見るとわかるように、連絡先の名前と電話番号を示す凡例が非表示になっています。他の画像は正しく引き伸ばされません。 これがGridView xmlファイルです。ご覧のとおり、columnWidthは200dpに設定されています。自動で行いたいので、画面サイズごとに画像のサイズが自動的に変更されます。 <?xml version="1.0" encoding="utf-8"?> <GridView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gridViewContacts" android:layout_width="fill_parent" android:layout_height="fill_parent" android:numColumns="2" android:columnWidth="200dp" android:stretchMode="columnWidth" android:gravity="center" /> 各アイテム自体を表すアイテムxmlファイルです。 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <ImageView android:id="@+id/imageViewContactIcon" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="fitXY" /> <LinearLayout android:id="@+id/linearlayoutContactName" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:paddingLeft="5dp" android:paddingTop="5dp" android:paddingBottom="5dp" android:background="#99000000" android:layout_alignBottom="@+id/imageViewContactIcon"> <TextView android:id="@+id/textViewContactName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#FFFFFF" android:textStyle="bold" android:textSize="15sp" …