アプリで 5 つの画像のリストの水平スクロールを作成しようとしました。アプリで次の XML を記述しました。私が直面している問題は、画面の左右に空白の領域が残ることです。つまり、画像リストが開始される前の空白領域と、画像リストの後の空白領域です。
XML
<?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center">
<LinearLayout
android:id="@+id/LinearLayout02"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:orientation="horizontal" >
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingRight="20dp"
android:src="@drawable/people" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingRight="20dp"
android:src="@drawable/people" />
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingRight="20dp"
android:src="@drawable/people" />
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingRight="20dp"
android:src="@drawable/people" />
</LinearLayout>
</HorizontalScrollView>
この不要な空白領域を削除する方法を教えてもらえますか?
NagarjunaReddy の提案を試してみましたが、下のスクリーンショットに示すような結果が得られました。