Android:Flash 内容打破 WebView 边界并重叠原生布局元素 [英] Android: Flash content breaks WebView boundings and overlaps native layout elements

查看:25
本文介绍了Android:Flash 内容打破 WebView 边界并重叠原生布局元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 WebView 显示一个网页,其中包含一些基本上运行良好的 Flash 内容.最大的问题是,Flash 内容似乎没有考虑 WebView 的边界:即使 WebView 太小而无法显示完整页面并且 Flash 内容不在 WebView 的边界内,也会显示 Flash 内容.此外,此 Flash 内容覆盖显示在 WebView 旁边的其他(本机)布局元素.对我来说,Flash 内容似乎是在(特殊的)z 层中呈现的,它覆盖了所有其他布局元素.

I'm using a WebView to display a web page which contains some Flash content which basically works pretty well. The big problem is, that the Flash content seems not to consider the WebView's boundings: The Flash content is displayed even if the WebView is too small to show the complete page and the Flash content is not inside the WebView's boundings. Moreover this Flash content overlays other (native) layout elements that are displayed next to the WebView. To me, it seems, that the Flash content is rendered in (special) z-Layer, that overlays all other layout elements.

已测试:Android 2.2 和 Flash 10.1.

Tested with: Android 2.2 and Flash 10.1.

这是 Adob​​es Flash player 10.1 中的已知错误吗?

Is this a known bug in Adobes Flash player 10.1?

推荐答案

我在使用 Flash 时遇到了同样的问题.我发现 Flash 视图是在 setZOrderOnTop 设置为 true 的情况下添加的.它会导致 flash 呈现在所有窗口之上(例如覆盖其他原生布局元素).

I had the same issue with flash. What I found out is that flash view is added with setZOrderOnTop set to true. It causes that flash is rendered on top of all windows (e.g. covers other native layout elements).

我有自己的 WebView 类,并覆盖了 addView 方法.当 WebView 添加任何视图时,我会检查它是否是 Flash 视图(通过检查com.adobe.flashplayer.FlashPaintSurface").如果是我将 Z order 设置为 false:

I had my own WebView class and I overridden addView methods. When WebView adds any view I check if it is a flash view (by checking "com.adobe.flashplayer.FlashPaintSurface"). If it is I set Z order to false:

@Override
public void addView(View child, int index)
{
    if (child.getClass().getName().equals("com.adobe.flashplayer.FlashPaintSurface"))
    {
        ((SurfaceView)child).setZOrderOnTop(false);
    }

    super.addView(child, index);
}

我对每个 addView 方法都这样做.它对我有用,我想我会分享它.

I do it for every addView method. It works for me and I thought that I will share it.

这篇关于Android:Flash 内容打破 WebView 边界并重叠原生布局元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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