【发布时间】:2015-02-18 20:29:42
【问题描述】:
在下面的代码中,我有两个主要容器,一个RelativeLayout 和一个ScrollView。我需要将 RelativeLayout 固定在顶部,而在其下方我需要带有图像的 ScrollView 可滚动。我有以下两个问题:
- 虽然我的 ScrollView 是可滚动的,但它位于 RelativeLayout 之上。 !重要
-
我在垂直 LinearLayout 中的图像视图是缩略图大小的。如果我有 15-20 张图片,它们会占用很多垂直空间。如何根据屏幕尺寸使图像适合最大的一行,然后转到下一行?
<RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> </LinearLayout> </RelativeLayout> <ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <ImageView> </ImageView> <ImageView> </ImageView> <ImageView> </ImageView> <ImageView> </ImageView> </LinearLayout> </ScrollView>
【问题讨论】:
标签: android android-layout scrollview android-imageview android-scrollview