I have a LinearLayhout that contains a listView and below it an ImageButton.
When I add items to the list, the imageButton is moving lower and lower, which is what I want but when there are many elements in the list so that is the list is big enough to fill the screen, I can scroll down to the bottom of the list, but no further, meaning I can’t see the imageButton anymore.
Code:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/add_interest_layout_root"
android:orientation="vertical"
android:layout_width="match_parent"
android:background="@color/back"
android:layout_height="match_parent">
<ListView android:id="@android:id/list"
android:layout_width="match_parent"
android:divider="@drawable/downa"
android:footerDividersEnabled="false"
android:cacheColorHint="@android:color/transparent"
android:layout_gravity="center"
android:layout_marginTop="6dp"
android:layout_height="wrap_content">
</ListView>
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="@+id/linearLayout2"
android:gravity="center">
<LinearLayout
android:orientation="vertical"
android:gravity="center_horizontal"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/LinearLayout16">
<ImageButton
android:src="@drawable/add"
android:id="@+id/btn_interest_more"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@android:color/transparent"></ImageButton>
<TextView
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="wrap_content"
android:id="@+id/TextView08"
android:text="be more\nspecific"
android:gravity="center"></TextView>
</LinearLayout>
</LinearLayout>
What am I doing wrong? I want to be able to see the ImageButton even when I scroll down.
You should do something like this. Mind you this is a pseudo code so you better fill the correct attributes.