Android のギャラリーの設定サイズに問題があります。ギャラリーのサイズを設定したい (デバイスの画面の半分など) 私はこのコードを使用しています:
int width = (int) getResources().getDimension(R.dimen.image_height);
int height = (int) getResources().getDimension(R.dimen.image_width);
iv.setLayoutParams(new Gallery.LayoutParams(width, height));
iv.setLayoutParams(new Gallery.LayoutParams(30, 40)); `
および main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/mySelection"
android:layout_width="fill_parent"
android:layout_height="
android:background="#ffffff"
android:textSize="20px"
android:textStyle="bold" />
<Gallery
android:id="@+id/myGallery"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:gravity="bottom"
android:spacing="
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_weight="0.46" />
</LinearLayout>`
images.xml
また、ファイルに深さと高さを設定しても機能しません。