I have this LinearLayout
containing a ListView
and a LinearLayout
:
<?xml version="1.0" encoding="utf-8"?>
<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="match_parent"
android:orientation="vertical">
<ListView
android:id="@+id/list_view"
android:layout_width="match_parent"
android:layout_height="fill_parent"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<EditText
android:layout_width="fill_parent"
android:layout_height="40dp"
android:hint="Hej"/>
</LinearLayout>
</LinearLayout>
The ListView
takes up the entire layout and the LinearLayout
with EditText
gets added below the bottom edge of the screen and isn't visible. How can I fix this? I tried with layout_weight
but didn't work.
match_parent
andfill_parent
do the exact same thing. No need to use them both. And in fact, you should only be usingmatch_parent
becausefill_parent
was deprecated in API 8. – Gaylagayle