안녕하세요~!
Webview에서 로드된 page의 height를 구하고 현재 scrollY의 위치를 구해 Custom으로 fast scroll button을 동적으로 생성/업데이트를 통해 구현하려고 합니다.
그래서 아래와 같이 확인해 보았는데, 현재 scrollY 가 height를 한참 넘어가고 있습니다.
WebView에서 로드된 page의 정확한 크기는 어떻게 구해야 하나요?
webView.setOnScrollChangeListener(new View.OnScrollChangeListener() {
@Override
public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
Log.d("TAG", "scrollY : " + scrollY);
Log.d("TAG", "webView.getScrollY() : " + webView.getScrollY());
Log.d("TAG", "webView.getHeight() : " + webView.getHeight());
Log.d("TAG", "webView.getMeasuredHeight() : " + webView.getMeasuredHeight());
Log.d("TAG", "webView.getContentHeight() : " + webView.getContentHeight());
Log.d("TAG", "webView.getScaleY() : " + webView.getScaleY());
}
});
03-08 18:30:42.497 2336-2336/com.example.sinyo.framelayout_testapp D/TAG: webView.getScrollY() : 6376
03-08 18:30:42.497 2336-2336/com.example.sinyo.framelayout_testapp D/TAG: webView.getHeight() : 1024
03-08 18:30:42.497 2336-2336/com.example.sinyo.framelayout_testapp D/TAG: webView.getMeasuredHeight() : 1024
03-08 18:30:42.497 2336-2336/com.example.sinyo.framelayout_testapp D/TAG: webView.getContentHeight() : 3700
03-08 18:30:42.497 2336-2336/com.example.sinyo.framelayout_testapp D/TAG: webView.getScaleY() : 1.0
미리 답변 감사드립니다!