Я внедрил SwipeRefreshLayout
в свое приложение, но он может содержать только один прямой дочерний элемент, который должен быть списком. Я пытаюсь понять, как добавить пустой текст в следующий рабочий XML файл:
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swipe_container"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ListView
android:id="@+id/listViewConversation"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:dividerHeight="1dp" />
</android.support.v4.widget.SwipeRefreshLayout>
Обтекание его в линейном/относительном макете делает его ошибкой, потому что listview всегда будет обновляться, когда вы хотите сместить резервную копию списка. Один из способов, я могу думать, делает это программно, но я думаю, что это не самый лучший вариант.
Вы можете узнать, как его реализовать, используя этот учебник: Проведите по экрану GUIDE
Итак, в основном все работает отлично, но я хотел бы добавить пустой вид, который показывает сообщение, когда listview пуст.