1

我想在 ImageView 上设置 SurfaceView。我使用了下面的代码和布局。它将表面视图设置在图像视图之上,但将表面视图设置为所有视图的顶部。

有没有其他方法可以在 ImageView 上设置 SurfaceView。

请帮我。

代码 :

setEGLConfigChooser(8, 8, 8, 8, 16, 0);
getHolder().setFormat(PixelFormat.TRANSLUCENT);
setZOrderOnTop(true);

布局

<FrameLayout
    android:id="@+id/topFrameLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <!-- ImageView for the product -->

    <ImageView
        android:id="@+id/photoImageView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <com.amplimesh.renderer.RendererView
        android:id="@+id/renderer_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@android:color/transparent" />
4

1 回答 1

0

确保添加

gl.glClearColor(0.0f, 0.0f, 0.0f, 0);

在您的渲染器中以确保背景是透明的。

于 2013-07-27T04:59:59.110 回答