2013-07-26 44 views
1

我想通過ImageView設置SurfaceView。我使用了下面的代碼和佈局。它在imageview上設置表面視圖,但它將surfaceview設置爲所有視圖的頂部。如何設置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" /> 

回答

0

確保你在你的渲染器添加

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

,確保背景是透明的。

+0

我甚至把它設置成黑色。所以在GLSurfaceview後面的imageview是不可見的。請幫助我如何使imageview可見 – user2601652

+0

請幫助我爲什麼它仍然是surfaceview黑色.. – user2601652