У меня есть RecyclerView, который отображает динамический контент. Я бы отобразил этот RecyclerView между другими представлениями. Например, один вид, показанный выше, и один вид, отображаемый под RecyclerView:
View
RecyclerView
View
Однако, что бы я ни пытался, похоже, не работает, и RecyclerView, кажется, занимает все пространство. Я считаю, что проблема заключается в проблеме wrap_content, хотя я пробовал некоторые предлагаемые решения, такие как этот пользовательский LinearLayoutManager, но это, похоже, не устраняет мою проблему.
Попытка
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- AppBar works fine; no issue here -->
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="@+id/app_bar_layout">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
app:layout_collapseMode="pin"/>
</android.support.design.widget.AppBarLayout>
<!-- Not displaying; Tried different views -->
<com.chrynan.taginput.view.TextInputWrapper
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/edit_text_container">
<AutoCompleteTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/edit_text"/>
</com.chrynan.taginput.view.TextInputWrapper>
<!-- Takes up entire screen space -->
<android.support.v4.widget.SwipeRefreshLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/swipe_refresh">
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/recycler_view"/>
</android.support.v4.widget.SwipeRefreshLayout>
<!-- Not displaying -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/text_view"/>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
Вопрос: Есть ли способ разместить и отобразить представление выше и представление ниже RecyclerView? Если да, то как? Или лучше использовать ListView?