wie man Oberflächensicht transparent macht
Hallo an alle ich möchte mein DrawingSurface Blick transparent. ich versuchte viele Dinge, aber es funktioniert nicht.
Hier mein xml-code, um mein surface view transparent
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/icon" >
</ImageView>
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#00000000" >
<codewalla.android.drawings.DrawingSurface
android:id="@+id/drawingSurface"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</codewalla.android.drawings.DrawingSurface>
</LinearLayout>
</FrameLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/colorRedBtn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="10"
android:onClick="onClick"
android:text="R" />
<Button
android:id="@+id/colorBlueBtn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="10"
android:onClick="onClick"
android:text="G" />
<Button
android:id="@+id/colorGreenBtn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="10"
android:onClick="onClick"
android:text="B" />
<Button
android:id="@+id/undoBtn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="10"
android:onClick="onClick"
android:text="U" />
<Button
android:id="@+id/redoBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="10"
android:onClick="onClick"
android:text="R" />
</LinearLayout>
</RelativeLayout>
InformationsquelleAutor der Frage Sunil Pandey | 2011-03-22
Du musst angemeldet sein, um einen Kommentar abzugeben.
Versuchen, diese im Konstruktor:
InformationsquelleAutor der Antwort TantanQi
wird die surfaceView auf der Oberseite des Fensters, das heißt, Sie können nicht hinzufügen von Elementen über die surfaceView.
Wenn Sie wollen das hinzufügen von Ansichten auf der Oberfläche anzuzeigen; sollten Sie in Betracht ziehen:
statt. Diese Orte, diese surfaceView auf der anderen surfaceViews, aber immer noch hinter dem Fenster, so dass Sie hinzufügen einer anderen sichtbaren Ansichten auf der Oberfläche anzeigen.
InformationsquelleAutor der Antwort Mikael Holmberg
Ist Ihre DrawingSurface und Erweiterung von SurfaceView?
Gibt es keine Möglichkeit, um eine SurfaceView zu tun, was Sie wollen, es zu tun. Die mechanik der Oberfläche zu sehen sind, so dass Sie können nicht alles haben, was im hintergrund sichtbar. (siehe die Antwort hier http://groups.google.com/group/android-developers/browse_thread/thread/8d88ef9bb22da574)
Getestet habe ich Ihre Hierarchie mit einer benutzerdefinierten Ansicht, die SurfaceView und ich sehe dein problem. Wenn ich wechseln, um eine benutzerdefinierte Ansicht, die einfach erweitert-Ansicht, bekomme ich Transparenz.
InformationsquelleAutor der Antwort slund
TexttureView
besser sein wird für Ihre Bedürfnisse alsSurfaceView
glaube ich.InformationsquelleAutor der Antwort VJ Vélan Solutions