私はAndroidの特別なUIに取り組んでいます-サンドイッチタイプ、背景ビュー(LinearLayout +いくつかのウィジェット)の上にあるGLSurfaceView(透明な領域を持つ)の小さなGalleryViewです。これは私がそれを設定する方法を考えている方法です:
<User>
TOP ビュー
---GalleryView
|
---GLSurfaceView(透明部分あり)
|
---LinearLayout(ウィジェットあり)
BOTTOM View
通常モードの GLSurfaceView では、透明な領域に黒い背景があるため、下のレイヤーが表示されませんが、 setZOrderOnTop(true); を使用すると、下のレイヤーが表示されます。一番下のレイヤーが見えますが、一番上のレイヤー(ギャラリー)もGlsurfaceビューの背後にあります。スキーマのように目的のビューを実現するにはどうすればよいですか?
XML コードのダミーの例 (GalleryView の代わりに 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>