我正在使用Android -Sandwich類型的一個特殊UI,在背景視圖(LinearLayout +一些小部件)上的GLSurfaceView(帶透明區域)上的一個小GalleryView。這是我正在考慮將其設置的:如何在Android Views之間添加GLSurfaceView?
<User>
頂視圖
---圖庫視圖
|
--- GLSurfaceView(帶透明區域)
|
---的LinearLayout(含部件)
底視圖
在GLSurfaceView對透明區域黑色背景常規模式,所以我看不到底層,但是當我使用setZOrderOnTop(真);我可以看到底層,但頂層(庫)也落後於Glsurface視圖。我如何才能完成想要的視圖,如架構?
XML代碼示例假人(與AnalogClock代替圖庫視圖):
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#920000"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/LinearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right" >
<AnalogClock
android:id="@+id/analogClock2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<com.test.CustomGlView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gl_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<AnalogClock
android:id="@+id/Gallery_dummyview"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
我沒有得到你想要的東西嗎?你需要編寫XML佈局的幫助嗎? –
我認爲這個問題不在佈局中,而是在GLSurfaceView設置中。默認情況下,無論我做什麼,它都不會顯示透明區域,直到我沒有設置ZOrderOnTop(true);但此設置將表面一直放在頂部......所以如何使用相同的佈局組合並在透明區域中Glsurfaceview? – prot0n