I try to prevent ScrollView from taking up too much space at the bottom of the screen, as it keeps my two buttons from showing. I also do not want to manually set the height for ScrollView.
<LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <LinearLayout ... android:orientation="horizontal"> <Button .../> <TextView .../> <Button .../> </LinearLayout> <ScrollView android:layout_width="math_parent" android:layout_height="wrap_content"> <ImageView .../> <ImageView .../> <ImageView .../> </ScrollView> <LinearLayout ... android:orientation="horizontal"> <Button .../> <Button .../> </LinearLayout> </LinearLayout>
This is a generalized version of my layout. What happens is that the ScrollView extends all the way to the bottom of the screen no matter how many elements are in it. This will cause the two buttons at the bottom of the screen to not be visible.
How can I stop this if I donβt manually set the height for ScrollView?
I used android:layout_height="wrap_content" for all of my views.
Shouldn't it automatically distribute the height of the views according to the height of the screen?
(It is required to include images, but my reputation is still not high enough (-_-))
source share