私はグロスフェイスをフルスクリーンで使用しています。ボタンをクリックすると別のレイアウトが表示されます(設定タイプのもの)。オーバーレイが表示されている状態から始めれば、私はそれを不可視にしてからもう一度問題なく表示することができます。しかし、私がそれを目に見えないものから始めると、私はそれを再び見ることができません。コードは次のとおりです:最初にインビジブルに設定されていればアンドロイドセットのビジビリティは表示されません
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<android.opengl.GLSurfaceView
android:id="@+id/glPlaySurface"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</android.opengl.GLSurfaceView>
<RadioGroup
android:id="@+id/radioGroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/btnRotate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:checked="true"
android:text="R"
android:textColor="#000" />
<RadioButton
android:id="@+id/btnPan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text="P"
android:textColor="#000" />
</RadioGroup>
<Button
android:id="@+id/btnLights"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="15dp"
android:layout_toRightOf="@+id/radioGroup1"
android:text="Lights" />
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layoutLights"
android:layout_width="100dp"
android:layout_height="100dp"
android:visibility="visible" <--- Does not work if set to invisible
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:background="#fff" >
<Button
android:id="@+id/btnLightsOK"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:text="OK" />
<Button
android:id="@+id/btnLights"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:text="OK" />
</RelativeLayout>
</RelativeLayout>
private OnClickListener mOnLightsClick = new OnClickListener() {
public void onClick(View arg0) {
if(mLayoutLights.getVisibility() == View.VISIBLE) {
mLayoutLights.setVisibility(View.INVISIBLE);
}
else {
mLayoutLights.setVisibility(View.VISIBLE);
}
}
};
問題はglsurfaceに関連しています。 glsurfaceを通常のサーフェイスビューに置き換えるとうまくいきます。 – user1248322
詳細情報:グランスサーフェスをGONEに設定した場合、レイアウトをVISIBLEに設定し、グラスサーフェスをVISIBLEに戻します。しかし、... gloneをGONEの代わりにINVISIBLEに設定すると、うまくいきません。 – user1248322
ok - apiデモのsurface_view_overlayは、私が探しているものとまったく同じです - 私はどこが間違っていたのか分かります。 – user1248322