android-Ultra-Pull-To-Refresh icon indicating copy to clipboard operation
android-Ultra-Pull-To-Refresh copied to clipboard

PrtFrameLayout没有自带Scrollview的功能吗

Open Ycocol opened this issue 7 years ago • 3 comments

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

Ycocol avatar Dec 04 '17 04:12 Ycocol

我也是这个问题

snowf07 avatar Dec 08 '17 01:12 snowf07

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

Ycocol avatar Dec 29 '17 06:12 Ycocol

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);
        }
    });

timi-codes avatar May 30 '18 14:05 timi-codes