Android的升级Froyo的WebView不垂直滚动 [英] Android Froyo WebView doesn't scroll vertically

查看:103
本文介绍了Android的升级Froyo的WebView不垂直滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序的WebView一个小工具,显示自定义HTML内容。这是我的布局:

I have a WebView widget in my app that displays custom HTML content. This is my layout:

<?xml version="1.0" encoding="utf-8"?>    
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:id="@+id/main_article_view"
 >
<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="56dp"
    android:background="@drawable/header_background">

<Button 
    android:id="@+id/article_next"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:background="@drawable/right_segment"
    android:layout_centerVertical="true"
    android:layout_alignParentRight="true"
    android:layout_marginRight="2dip"
/>

<Button 
    android:id="@+id/article_previous"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:background="@drawable/left_segment"
    android:layout_centerVertical="true"
    android:layout_alignBaseline="@id/article_next"
    android:layout_toLeftOf="@id/article_next"
/>



<ImageView 
    android:layout_width="wrap_content"
    android:id="@+id/article_nav_logo" 
    android:layout_height="wrap_content"
    android:background="@drawable/app_logo"
    android:layout_toLeftOf="@id/article_previous"
    android:layout_centerVertical="true"
    android:layout_marginRight="15dp"/>

</RelativeLayout>

<com.myapp.android.NavBar
    android:id="@+id/vertical_navbar"
    android:layout_width="fill_parent"
    android:layout_height="45dp"
/>


<WebView
        android:id="@+id/webkit"
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
/>


</LinearLayout>

在code是非常简单的 - 处理布局也实现了WebViewClient方法的类。它加载的HTML数据到的WebView。

The code is really simple - the class that handles the layout also implements the WebViewClient methods. It loads the html data into the WebView.

该应用程序运行良好在所有操作系统的升级Froyo除外。在升级Froyo web视图不响应垂直滚动的事件 - 它可以水平滚动虽然

The app works well on all OS's except Froyo. On Froyo the WebView doesn't respond to vertical scroll event - it can scroll horizontally though.

我有一个onFling事件监听器 - 这已被禁用,但仍没有运气。任何帮助/提示是大大AP preciated。谢谢你。

I had a onFling event listener - which has been disabled, but still no luck. Any help/hint is greatly appreciated. Thanks.

推荐答案

你问的问题的那一刻....我发现这个问题,林不知道,如果它关系到的WebView。在我的HTML模板我有这个

The moment you ask the question.... I found the issue and Im not sure if it is related to WebView. In my html template I have this

<meta name = "viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

此设置将导致的WebView冻结起来的升级Froyo。后来我发现这个建立网页,以支持不同的屏幕密度这<一个href=\"http://stackoverflow.com/questions/2909080/android-webview-seems-to-ignore-viewport-information-on-web-pages\">question在计算器。希望它可以帮助别人的路线。

This setting will cause the WebView to freeze up on Froyo. Later I found this Building web pages to support different screen densities and this question on stackoverflow. Hope it helps someone else down the line.

这篇关于Android的升级Froyo的WebView不垂直滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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