我正在开发一个android视频应用程序,其中我将列出每个视频的截图图像,每个视频至少有10个视频。而且,我使用的是线性布局,它位于nestedscrollview内,显示这些图像,但仅适用于当我放置3个图像时如果我把3个以上的ImageView那么它不会在所有的工作和应用程序不respond.Here是screenshot.xml文件的我的XML布局..如何在线性布局内显示多个图像?
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="180dp"
android:scaleType="centerCrop"
android:src="@drawable/alaep1b" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="180dp"
android:scaleType="centerCrop"
android:src="@drawable/alaep1c" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="180dp"
android:scaleType="centerCrop"
android:src="@drawable/alaep1j" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="180dp"
android:scaleType="centerCrop"
android:src="@drawable/alaep1f" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="180dp"
android:scaleType="centerCrop"
android:src="@drawable/alaep1g" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="180dp"
android:scaleType="centerCrop"
android:src="@drawable/alaep1h" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="180dp"
android:scaleType="centerCrop"
android:src="@drawable/alaep1m" />
</LinearLayout>
什么是错我的代码?
感谢您的回复,但是如果您可以给我一个使用我的代码的recyleview示例吗? –
我认为这个例子中有很好的记录,我为你提供。您只需要将适配器中的TextView更改为ImageView,然后您就可以开始使用了:) – Konrad