Position images at the bottom using a Gallery View
-
30-05-2021 - |
Question
I was reading the Gallery View tutorial : http://developer.android.com/resources/tutorials/views/hello-gallery.html. Is there anyway I can position the images at the bottom and not at the top? In other words, I would like to show the toast messages above the images.
Solution
modify your res/layout/main.xml something like
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Gallery
android:id="@+id/gallery"
android:layout_alignParentBottom="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
Moreover you can also set the Toast
position toast.setGravity(Gravity.TOP|Gravity.LEFT, 0, 0);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow