How to hide footer while scrolling up webview in android?

十年热恋 提交于 2019-12-11 09:09:13

问题


I have webview with linear layout with three buttons at bottom i.e. footer. I want to hide that footer while scrolling up webview and show footer on scrolling down.

Please Help me!!!


回答1:


Try this, I also never tried so let me know if it worked or not.

 scroll.setOnTouchListener(new OnTouchListener() {

            public boolean onTouch(View v, MotionEvent event) {

                if (event.getAction() == MotionEvent.ACTION_UP) {

                   //show footer
                }
else  if (event.getAction() == MotionEvent.ACTION_DOWN) {

                   //hide footer
                }    
                return false;
            }
    });


来源:https://stackoverflow.com/questions/28711764/how-to-hide-footer-while-scrolling-up-webview-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!