使滾動動畫背景沒有填滿,我做錯了什麼?android hide/show工具欄沒有填充空格底部
我使用 - DrawerLayout - V7工具欄 - 尋呼機 - SwipeRefreshLayout - RecyclerView
活動
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"></FrameLayout>
片段尋呼機容器
<RelativeLayout 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:orientation="vertical">
<com.squidit.squid.ui.widget.SlidingTabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="2dp"
android:background="@color/primaryColor"/>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
片段內容
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/missionSwipeRefresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
滾動隱藏
private void hideViews() {
mToolbar.animate().translationY(-mToolbar.getHeight()).setInterpolator(new DecelerateInterpolator(2));
container.animate().translationY(-mToolbar.getHeight()).setInterpolator(new DecelerateInterpolator(2)).start();
}
問題:
容器上升到頂部,但通過將其預先在底部所佔據的空間是無填充
Ilustration:
https://drive.google.com/open?id=0B-Vxv0Qpz2dqcWp5eDVRbmd3czQ&authuser=0
您的插圖無法正常工作,需要權限。你爲什麼將整個容器與工具欄一起移動? –
@MichałZ。請再次檢查鏈接。我發現我的問題是與抽屜佈局有關,但尚未決定。 –