Im trying to build a chat app and although my listview does append a messages as they come in, I cannot access the messages that are older or hidden from the screen. The listview does not want to scroll and just display the amount of messages that fit onto the screen which are the most recent ones. It still does not work. Something to note i have a expanding toolbar and this layout is on a fragment
Edit: To fix this problem of the listview not scrolling add
android:nestedScrollingEnabled="true"
to the listview that is not scrolling Code:
<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"
android:id="@+id/main"
android:weightSum="1"
android:background="@drawable/bg_messages">
<ListView
android:id="@+id/list_view_messages"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:divider="@null"
android:stackFromBottom="true"
/>
<LinearLayout
android:id="@+id/llMsgCompose"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
android:weightSum="3"
android:layout_gravity="center|bottom"
>
<EditText
android:id="@+id/inputMsg"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="2"
android:paddingLeft="6dp"
android:paddingRight="6dp" />
<Button
android:id="@+id/btnSend"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/white"
android:text="Send" />
</LinearLayout>