I am making an android application that uses these views:
(Root) – LinearLayout
(Child of root) – ListView + 3 other linearlayouts beneeth that listview. But once i add to many items to the listview, the layouts are being placed outside of the screen. Which i don’t want to. How can i make this happen? So that all of the three linearlayouts stay on the screen, at the bottom??? Please help and thanks in advance!
My screen XML code:
<?xml version="1.0" encoding="utf-8"?>
LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
android:orientation="vertical" >
<TextView
android:id="@+id/NotesWelcomeTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/NotesWelcomeText" />
<ListView
android:id="@+android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</ListView
<LinearLayout
android:id="@+id/DeleteAllItemsFromListViewLinearLayout"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1"
android:visibility="invisible" >
<Button
android:id="@+id/CancelButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Cancel" />
<Button
android:id="@+id/DeleteAllButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Delete" />
</LinearLayout>
<LinearLayout
android:id="@+id/DeleteItemFromListViewLinearLayout"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1"
android:visibility="invisible" >
<Button
android:id="@+id/CancelButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Cancel" />
<Button
android:id="@+id/DeleteButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Delete" />
</LinearLayout>
<LinearLayout
android:id="@+id/AddItemToListViewLinearLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="gone" >
<EditText
android:id="@+id/AddItemToListViewEditText"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_weight="1" >
</EditText>
<Button
android:id="@+id/AddItemToListViewButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/Add" />
</LinearLayout>
</LinearLayout>
Try this, you’ll have to add the string references and background again, I removed them so I wouldn’t have errors