2016-06-08 1 views
0

나는 WebView입니다. 페이지를 스크롤 할 때마다 페이지 맨 위에있을 때를 감지하고 싶습니다. 어떻게해야합니까?WebView에서 Top 페이지를 감지하는 방법은 무엇입니까?

은 내가

implements OnScrollListener 

을 확장하고 내가

@Override 
protected void onScrollChanged(int l, int t, int oldl, int oldt) { 

    if(view.getTop()==t){ 
     // reaches the top end 
     } 

    View view = (View) getChildAt(getChildCount()-1); 
    int diff = (view.getBottom()-(getHeight()+getScrollY()+view.getTop()));// Calculate the scrolldiff 
    if(diff <= 0){ 
     // if diff is zero, then the bottom has been reached 
     Log.d(ScrollTest.LOG_TAG, "MyScrollView: Bottom has been reached"); 
      } 
    super.onScrollChanged(l, t, oldl, oldt); 
} 

그것은 나를 "방법이다주는 오류를 추가 할 수

@Override public void onScroll(AbsListView arg0, int arg1, int arg2, int arg3) { // TODO Auto-generated method stub } @Override public void onScrollStateChanged(AbsListView arg0, int arg1) { // TODO Auto-generated method stub } 

그러나 자동

을이 두 가지를 추가 onScrollChanged MainActivity 유형의 (int, int, int, int)는 수퍼 유형 메소드 "

+0

우편 번호. – Sush

답변

관련 문제