liaohuqiu / android-Ultra-Pull-To-Refresh

Ultra Pull to Refresh for Android. Support all the views.
MIT License
9.58k stars 2.65k forks source link

PrtFrameLayout没有自带Scrollview的功能吗 #324

Open Ycocol opened 6 years ago

Ycocol commented 6 years ago

是不是需要设置其他属性才可以滑动PrtFrameLayout?自己在PrtFrameLayout下加了子Scrollview,然后上拉顶部会被隐藏掉。

snowf07 commented 6 years ago

我也是这个问题

Ycocol commented 6 years ago

貌似是没有,我是直接加了ScrollVieww.

timi-codes commented 6 years ago

Try this

    mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
        @Override
        public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
            // TODO Auto-generated method stub
            //super.onScrollStateChanged(recyclerView, newState);
            int firstPos = mLayoutManager.findFirstCompletelyVisibleItemPosition();
            if (firstPos > 0) {
                ptrFrameLayout.setEnabled(false);
            } else {
                ptrFrameLayout.setEnabled(true);
            }
        }

        @Override
        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
            super.onScrolled(recyclerView, dx, dy);
        }
    });