0

I set my ListView in Android Studio like this:

<ListView
    android:layout_width="match_parent"
    android:layout_height="200dp"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:id="@+id/listView" />

and attached it to the bottom of the screen. But if I run the app, the ListView extends and fills the entire screen.

G. Lukas
  • 63
  • 1
  • 1
  • 9

2 Answers2

0

remove this line

 android:layout_alignParentBottom="true"
n00b
  • 1,832
  • 14
  • 25
0

I think you are using LinearLayout insted of RelativeLayout in your .xml file. Use RelativeLayout

Arpit Prajapati
  • 367
  • 2
  • 16
  • I am using RelativeLayout. I also noticed, that if I add some Items to the ListView and then scroll in there, the ListView gets back to its defined place. Just if i click in the EditText above, the ListView "jumps" up to the bottom of the EditText. – G. Lukas Feb 22 '17 at 09:32
  • @G.Lukas check onclick function for EditText. Provide some more information about .xml file and .java file – Arpit Prajapati Feb 23 '17 at 06:13