I want to implement this:
I have an ImageView
at the top of screen, always stays there. Above it I use an ScrollView
, with some objects that depends on the Activity
. And finally, I have another ImageView
whose behaviour should be:
Stay in the bottom of the view with big screens, it is, when there is too much space after the objects inside
ScrollView
and before the end of the screen.Be scrolled with small screens, it is, when all objects can't be seen, they will be scrollable, and I want to see that
ImageView
at the end.
Here is my code up to date
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:context=".ContactoActivity"
android:orientation="vertical" >
<!-- LinearLayout with ImageView I have at the top of the view -->
<ScrollView
android:id="@+id/scrollViewMain"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/linearLayoutLogoFactor_contacto"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/relativeLayoutMain"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true">
<!-- Some other objects -->
<!-- ImageView I want to stay at the bottom but being scrollable -->
<LinearLayout
android:id="@+id/linearLayoutImagenInferior_contacto"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/linearLayoutVerInfoContacto"
android:gravity="center_horizontal" >
<ImageView
android:id="@+id/imageViewImagenInferior_contacto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@drawable/la_electrica_de_las_empresas" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
</LinearLayout>
Is there any easy way for doing that? Or what should I do?