ImageView と HorizontalScrollView でレイアウトを作成しています。下の画像のように見えます..
ユーザーが HorizontalScrollView で画像の 1 つをクリックすると、ImageView に大きな画像が表示されます。
これまでのところ、私のコードは以下です
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:id="@+id/imageViewTop"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
/>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
>
<HorizontalScrollView
android:id="@+id/mainHorizontalScrollView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@color/orange"
>
<ImageView
android:id="@+id/image1"
android:layout_width="150dp"
android:layout_height="150dp"
android:scaleType="fitXY"
android:src="@drawable/pic1"
android:padding="15dp"
></ImageView>
<ImageView
android:id="@+id/image2"
android:layout_width="150dp"
android:layout_height="150dp"
android:scaleType="fitXY"
android:src="@drawable/pic2"
android:padding="15dp"
></ImageView>
</LinearLayout>
</HorizontalScrollView>
</RelativeLayout>
上記のコードは、ImageView が画面全体を埋めるようにします。