Я использую CoordinatorLayout
с RecyclerView
.The приложение работает нормально, но моя проблема заключается в вид должен прокручивать только как элементы в RecyclerView
.В моем случае у меня есть только три вещи, но CordinatorLayout
будет прокручивать RecyclerView
пока она не будет прилипать к вершине из-за этого я получаю ниже часть, как белыми, как listsize только 3.координатор Компоновка с RecyclerView
Xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:contentScrim="@android:color/transparent"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/textView38"
android:layout_alignParentTop="true"
android:padding="20dp"
android:src="@drawable/ic_filter_back" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_event_details"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#fff"
android:orientation="horizontal"
android:paddingBottom="03dp">
<RelativeLayout
android:id="@+id/rl_tab1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<ImageView
android:id="@+id/tab1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:padding="05dp"
android:src="@drawable/ic_create_wedding_admin" />
<TextView
android:id="@+id/tv_tab_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tab1"
android:layout_marginLeft="05dp"
android:layout_marginRight="05dp"
android:gravity="center"
android:text="Admin" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_tab2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<ImageView
android:id="@+id/tab2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:padding="05dp"
android:src="@drawable/ic_create_wedding_guests" />
<TextView
android:id="@+id/tv_tab_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tab2"
android:layout_marginLeft="05dp"
android:layout_marginRight="05dp"
android:gravity="center"
android:text="Guests" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_ed_tab_guests"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<ImageView
android:id="@+id/iv_ed_iv_budget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:padding="05dp"
android:src="@drawable/ic_create_wedding_budget" />
<TextView
android:id="@+id/tvbud"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/iv_ed_iv_budget"
android:layout_marginLeft="05dp"
android:layout_marginRight="05dp"
android:gravity="center"
android:text="Budget" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_ed_tab_tasks"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<ImageView
android:id="@+id/iv_ed_iv_tasks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:padding="05dp"
android:src="@drawable/ic_create_wedding_tasks" />
<TextView
android:id="@+id/tv_ed_tasks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/iv_ed_iv_tasks"
android:layout_marginLeft="05dp"
android:layout_marginRight="05dp"
android:gravity="center"
android:text="Tasks" />
</RelativeLayout>
</LinearLayout>
Что я хочу, чтобы прокрутите представление только до размера элемента.
Возможный дубликат [Android CoordinatorLayout + AppbarLayout + ViewPager всегда прокрутки] (http://stackoverflow.com/questions/32648051/android-coordinatorlayout-appbarlayout- ViewPager-всегда-прокрутка) – Keshav