Is there a way to add a footer-sized image to the bottom of any mobile application?
Asked
Active
Viewed 44 times
1 Answers
1
The best way to do this is by adding a layout set to the bottom of you activity while letting the rest of the screen scrollable. You can achive this by doing the following:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<ScrollView
android:id="@+id/scrollablContent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/footerView"
android:layout_below="@+id/headerView" >
<LinearLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/footerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/image_name" />
</LinearLayout>
</RelativeLayout>
You can also remove the bottom LinearLayout if you just wish to add an Image and nothing in addition to it. Also similarly a header can be added.

animeshk
- 376
- 1
- 7
-
Thank you very much for your answer, but I was too imprecise with my question. I meant existing mobile applications. I will create a new question, I am sorry. – Dec 20 '19 at 21:41