原因是在創建Item時將layout_height屬性設成了match_parent,致使一個Item充滿了一頁屏幕,只要將此屬性改為wrap_parent就可以了。
<LinearLayout xmlns:
android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/video_image"
android:layout_width="80dp"
android:layout_height="80dp" />
<TextView
android:id="@+id/video_name"
android:layout_width="match_parent"
android:layout_height="80dp"
android:gravity="center"/>
</LinearLayout>
