Trong hoạt động xem web của tôi, tôi có thể cuộn trang web theo chiều dọc (lên và xuống) nhưng tôi không thể cuộn theo chiều ngang (từ phải sang trái hoặc từ trái sang phải), khi tôi phóng to trang web quá, vẫn không có cuộn ngang.Bật cuộn ngang trong chế độ xem web
Có khả năng nào để thêm điều này trong chế độ xem web không? Cảm ơn bạn rất nhiều.
getWindow().setFeatureInt(Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setBuiltInZoomControls(true);
mWebView.getSettings().setSupportZoom(true);
mWebView.setVerticalScrollBarEnabled(true);
mWebView.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress)
{
//Make the bar disappear after URL is loaded, and changes string to Loading...
MyActivity.setTitle("Loading...");
MyActivity.setProgress(progress * 100); //Make the bar disappear after URL is loaded
// Return the app name after finish loading
if(progress == 100)
MyActivity.setTitle(R.string.app_name);
}
});
mWebView.setWebViewClient(new Manipulation());
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl(myURL);
XML:
<?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/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
Theo truyền thống WebView trong Andr oid hỗ trợ di chuyển ngang theo mặc định. Có lẽ bạn đang vô hiệu hóa nó trong mã của bạn bằng cách nào đó hoặc bạn không xem một trang cuộn theo chiều ngang? – bbedward
@bbedward: vui lòng xem mã của tôi – androniennn