In my activity i hava a ListView which has an ArrayAdapter as its adapter, and is updated dynamically. I am using RelativeLayout. At first, the ListView is empty, but I can see that it takes up space on the screen compared to before i added it. As soon as one element is added, it is expanded and shows this element. As soon as I add a second element, I only see the top of the second element and then it goes behind the message text element under. How can I solve this?
<Button
android:id="@+id/btnAddAttachment"
android:layout_marginTop="7dp"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_below="@id/sprType"
android:text="Add attachment"/>
<!--ATTACHMENTS LIST-->
<ListView
android:id="@+id/lstAttachments"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/btnAddAttachment">
</ListView>
<!-- MESSAGE TEXT -->
<EditText
android:id="@+id/txtMessage"
android:layout_width="fill_parent"
android:layout_height="150dp"
android:layout_below="@id/lstAttachments"
android:layout_marginTop="7dp"
android:lines="10"
android:maxLines="10"
android:maxLength="500"
android:hint="Message text"
android:gravity="top|left"/>