使用带标签的Parallax Scrolling Header时,无法隐藏底部导航栏

时间:2018-04-10 18:25:40

标签: android

当我滚动心愿单时,我无法隐藏导航栏,它始终保持在那里。

1 个答案:

答案 0 :(得分:0)

 mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
            @Override
            public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
                if (dy > 0 && bottom_navigation.isShown()) {
                    bottom_navigation.setVisibility(View.GONE);
                } else if (dy < 0 ) {
                    bottom_navigation.setVisibility(View.VISIBLE);

                }
            }

            @Override
            public void onScrollStateChanged(RecyclerView recyclerView, int newState) {

                super.onScrollStateChanged(recyclerView, newState);
            }
        });