사용자가 웹 페이지를 아래로 스크롤하고 사용자가 웹 페이지를 맨 위로 스크롤 한 다음 위쪽으로 스크롤하면 숨길 수있는 기본 브라우저 앱과 같은 주소 표시 줄을 구현하고 싶습니다.WebView에서 스크롤 할 주소 목록 표시 줄을 구현하려면 어떻게해야합니까?
감사합니다. 자신의 손가락으로 사용자가 스크롤 및 모든 손가락을 해제하는 경우
mWebView.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent me){
if(me.getAction() == MotionEvent.ACTION_UP){ //You might try with MotionEvent.ACTION_MOVE also, but you'll get way more calls.
if(mWebView.getScrollY() == 0){
//You are at the top, do what you need to do in order to show your address bar.
}
}
return false;
}
});
이 예제가 작동합니다
언제든지 [브라우저 소스 코드] (http://android.git.kernel.org/?p=platform/packages/apps/Browser.git;a=summary)를 읽을 수 있습니다. –