在Android中不能滚动网页视图 [英] Can't scroll webview in Android

查看:568
本文介绍了在Android中不能滚动网页视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我和我的WebView一些奇怪的问题。问题是,我不能在Android 2.2的滚动页面和2.3,如果它比屏幕长。滚动的WebView的唯一方法是在Android的4.0.3。有什么问题或只是无法滚动的WebView的Andr​​oid的版本低于4.0.3低?

I got some strange problem with my WebView. The problem is that I can't scroll the page in Android 2.2 and 2.3 if it's longer than the screen. The only way to scroll the WebView is in Android 4.0.3. What's the problem or is it just not possible to scroll the WebView in Android versions lower than 4.0.3?

这是我的布局:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
    android:layout_width="fill_parent" android:id="@+id/rltvLayout01"
    android:layout_height="fill_parent" android:background="@color/white">  
    <LinearLayout android:id="@+id/LinearLayout01"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_above="@+id/ad_layout">
            <WebView android:id="@+id/webview"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:fitsSystemWindows="true"
                android:scrollbars="none" />
    </LinearLayout>
    <LinearLayout android:id="@+id/ad_layout"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true">
            <com.google.ads.AdView android:id="@+id/ad"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                ads:adUnitId="-------------"
                ads:loadAdOnCreate="true"
                ads:adSize="BANNER" />
    </LinearLayout>
</RelativeLayout>

修改23:06:

我刚刚发现的问题!实际code我使用不会导致此行为,它的加载网站的导致的问题。在我的移动网站我使用视正确显示它与升级Froyo和姜饼的的WebView无法处理那么好。因此,移除视窗meta标签后,它的作品完美!谢谢反正托马斯·K,在垂直方向也使得滚动取出后视!

I just found the problem! The actual code I'm using is not causing this behavior, it's the loaded website that's causing the problem. In my mobile website i'm using viewport to show it correctly and FroYo and Gingerbread's WebView can't handle that well. So after removing the viewport meta tag it works perfect! Thank you anyway Thomas K, the vertical orientation also made it scrollable after removing the viewport!

因此,在你的HTML code摆脱视口标签,如果你想拥有你的WebView在升级Froyo和姜饼的工作!

推荐答案

添加

android:orientation="vertical"

android:orientation="horizontal"

要的LinearLayout

to LinearLayout

这篇关于在Android中不能滚动网页视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆