Alle Imageviews in RelativeLayout löschen?

S

sebush

Neues Mitglied
0
hi leutz, ich möchte alle ImageViews in einem RelativeLayout löschen, allerdings eben auch nur die ImageViews...

Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   	android:orientation="vertical"
   	android:layout_width="fill_parent"
   	android:layout_height="fill_parent"	>		
	<RelativeLayout
	    android:id="@+id/relativeLayout"
	    android:layout_width="match_parent"
	    android:layout_height="wrap_content" >
		<SurfaceView
		    android:id="@+id/surfaceview"
		    android:layout_width="fill_parent"
		    android:layout_height="fill_parent"
		    android:layout_alignParentLeft="true"
		    android:layout_alignParentTop="true" />
		<ImageView
		    android:layout_width="wrap_content"
		    android:layout_height="wrap_content"
		    android:layout_alignParentLeft="true"
		    android:layout_alignParentTop="true"
		    android:layout_marginLeft="89dp"
		    android:layout_marginTop="181dp"
		    android:src="@drawable/ic_launcher" />
		<ImageView
		    android:layout_width="wrap_content"
		    android:layout_height="wrap_content"
		    android:layout_alignParentLeft="true"
		    android:layout_alignParentTop="true"
		    android:layout_marginLeft="89dp"
		    android:layout_marginTop="141dp"
		    android:src="@drawable/ic_launcher" />
		... more images ...
	</RelativeLayout>
</LinearLayout>

die images werden dynamisch erzeugt also evtl liegen sie auch vor dem surface ... kein plan bin noch zu neu und muss lernen...

relativeLayout.addView(img, lp);

ich versuche derzeit per :
relativeLayout.removeViewAt(1);
die dynamisch generierten bilder zu löschen ...

frage #1: positioniert addView die bilder hinter dem surface?
frage #2: ist mein vorgehen zum löschen der dyn. bilder mit relativeLayout.removeViewAt(1); die richtige lösung?
frage #3: gibt es einen befehl um dur spezielle View-Typen zu entfernen... eben in meinem fall ImageViews?

komischerweiße bleiben die bilder zumindest meist stehen ...
 
warum nicht einfach

removeView(myImg);

du kennst die imageviews ja
 

Ähnliche Themen

D
Antworten
23
Aufrufe
2.551
Data2006
D
W
Antworten
0
Aufrufe
569
wippland
W
OnkelLon
Antworten
13
Aufrufe
1.986
OnkelLon
OnkelLon
Zurück
Oben Unten