Tôi đang cố sử dụng phương thức scrollTo của chế độ xem web. Đây là tệp bố cục của tôi cho chế độ xem web.Cuộn qua WebViewĐể không hoạt động
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<WebView
android:id="@+id/webMap"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
Những gì tôi đang cố gắng để làm là thể hiện một file html (trong đó có duy nhất một hình ảnh bản đồ) và di chuyển đến khu vực nhất định trên hình ảnh với:
mapWebView.loadUrl("file:///android_asset/maps/map.html");
mapWebView.scrollTo(300, 300);
Nhưng khi webview được nạp nó luôn hiển thị (0, 0) của hình ảnh.
Sự cố với scrollTo()
ở đây là gì?
Hãy xem @ http://stackoverflow.com/questions/22737412/android-webview-scrollto-is-not-working/22920457#22920457 –