Android,我试图在滚动gridView时隐藏textView,并在用户停止滚动时使其可见

时间:2014-09-29 11:45:31

标签: android onscrolllistener

在下面的代码中,只调用onScroll方法并且永远不会调用onScrollStateChanged方法,请您帮我解决此问题:

mGridView.setOnScrollListener(new OnScrollListener() {

        @Override
        public void onScroll(AbsListView view, int firstVisibleItem,
                int visibleItemCount, int totalItemCount) {

            check_text.setVisibility(View.VISIBLE);

            System.out.println("Inside onScroll");
        }

        @Override
        public void onScrollStateChanged(AbsListView view, int scrollState) {

            if(scrollState == SCROLL_STATE_IDLE)
             {
                check_text.setVisibility(View.VISIBLE);  
                System.out.println("Inside onScrollStateChanged");
             }              
        }
    });

0 个答案:

没有答案