ScrollView and footer in android

In my Android app, I use the header and footer. Between them, I have a table inside the scroll.
The problem is that I cannot see the footer, even if I add it the same way as the header using the include tag.
If I set the scroll height and width for a specific given length, it will work fine, but then again, when it changes orientation, it won’t.

Can someone let me know how I can make my footer visible at the bottom of the screen without changing the scroll height?

+6
android scrollview
source share
2 answers

I assume the root view is LinearLayout . If so, be sure to set the following attributes for the middle ScrollView :

 <ScrollView ... android:layout_height="wrap_content" android:layout_weight="1"> ... </ScrollView 
+10
source share

Your footer should have android:layout_marginTop="-95sp" and your scroll view should have android:layout_marginBottom="95sp"

Change the number (95) to the size of the footer.

+1
source share

All Articles