Here is my main layout:
<LinearLayout 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="fill_parent" android:animateLayoutChanges="true" android:orientation="vertical"> <RelativeLayout android:id="@+id/top_con" android:layout_width="match_parent" android:layout_height="64dp" android:background="#cc0000"> <TextView android:id="@+id/close" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:clickable="true" android:text="Close" android:textColor="#ffffff" /> </RelativeLayout> <android.support.design.widget.CoordinatorLayout android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#ffffff"> <android.support.design.widget.AppBarLayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/blue" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:layout_scrollFlags="scroll|enterAlways" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /> </android.support.design.widget.AppBarLayout> <FrameLayout android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/green" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> </android.support.design.widget.CoordinatorLayout>
After the onClick on TextView (id / close) event, I set visibility for RelativeLayout (id / top_con) to GONE . But FrameLayout (contain the recycler point of view) still keep their height , and there is a space below (white - the background color of CoordinatorLayout). What is a problem and how can I fix it? Thanks!
source share