Jetzt kostenlos registrieren. Mitglieder surfen ohne Werbung auf Android-Hilfe.de!
Zurück   Android-Hilfe.de > Android Developer > Android App Entwicklung

Buttons werden statt einmal, für jedes Listen Element wiederholt angezeigt

Das Thema "Buttons werden statt einmal, für jedes Listen Element wiederholt angezeigt" befindet sich unter Android App Entwicklung auf Android-Hilfe.de.


Antwort

 

Themen-Optionen Ansicht
Alt 23.08.2011, 14:49   #1 (permalink)
Neuer Benutzer

Registriert seit: 07.04.2011
Beiträge: 12
Abgegebene Danke: 3
Erhielt 0 Danke für 0 Beiträge
Standard Buttons werden statt einmal, für jedes Listen Element wiederholt angezeigt

Hallo zusammen,

der Titel beschreibt meine vorliegende Problematik. Meine xml sieht folgendermaßen aus:
Code:
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content" android:orientation="vertical">

  <HorizontalScrollView 
        android:id="@+id/my_scrollview"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:scrollbars="none" 
                >
              
 <LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:id="@+id/LinearLayout01" android:layout_height="wrap_content">

            <Button android:text="@string/home" android:drawableTop="@drawable/back_home" android:layout_width="wrap_content" android:layout_height="match_parent" android:id="@+id/repoHome"></Button>

            <Button android:text="@string/back" android:drawableTop="@drawable/back_icon" android:layout_width="wrap_content" android:layout_height="match_parent" android:id="@+id/repoBack"></Button>

            <Button android:text="@string/refresh" android:drawableTop="@drawable/refresh_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/repoRefresh"></Button>

        </LinearLayout>

</HorizontalScrollView>

  <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:id="@+id/linearLayout1" android:layout_height="fill_parent">

      <ImageView android:id="@+id/img" android:layout_width="wrap_content" android:layout_margin="5px" android:layout_height="wrap_content"></ImageView>

      <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:id="@+id/linearLayout2" android:layout_height="wrap_content">

          <TextView android:textSize="16sp" android:textStyle="bold" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/childrenFolderTitle" android:text="FolderName"></TextView>

          <TextView android:textSize="10sp" android:textStyle="bold" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/author" android:text="Author"></TextView>
      </LinearLayout>
  </LinearLayout>

</LinearLayout>
mein simpleadapter aufruf sieht folgendermaßen aus:
Code:
	adapter = new SimpleAdapter(this, ServiceDocumentFolder.getDataForView(
				entry, idFolder, idDocument), R.layout.children_folder,

		new String[] { "title", "author", "img" },

		new int[] { R.id.childrenFolderTitle, R.id.author, R.id.img });
Ich vermute das Problem ist ,dass die Buttons im selben Layout sind und so jedes mal neu aufgerufen werden. Aber ich weiß nicht, wie ich das lösen soll?

Gruß,
Benny
xben89 ist offline   Mit Zitat antworten
Alt 23.08.2011, 16:15   #2 (permalink)
Erfahrener Benutzer

Modell: G1 DevPhone / SGS2 / SGT10.1v

Registriert seit: 20.01.2009
Beiträge: 238
Abgegebene Danke: 7
Erhielt 50 Danke für 47 Beiträge
Standard AW: Buttons werden statt einmal, für jedes Listen Element wiederholt angezeigt

Wenn die obere XML dein Layout für die "Rows" darstellt, dann ist es recht logisch, dass sie jedesmal erscheinen?
Wenn du sie nur einmal haben willst, dann musst du die Buttons in der XML deklarieren, in der deine Liste (ListView!) enthalten ist.
sixi ist offline   Mit Zitat antworten
Alt 24.08.2011, 10:04   #3 (permalink)
Neuer Benutzer

Registriert seit: 07.04.2011
Beiträge: 12
Abgegebene Danke: 3
Erhielt 0 Danke für 0 Beiträge
Standard AW: Buttons werden statt einmal, für jedes Listen Element wiederholt angezeigt

ia stimmt..ich habs jetzt dort eingefügt, wo meine listview ist. Aber das Problem ist jetzt dass es so aussieht als würde meine listview alle überdecken..ich seh die buttons überhaupt nicht. Woran liegt das?

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="wrap_content"
   >
      
   

<HorizontalScrollView 
        android:id="@+id/my_scrollview"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:scrollbars="none" 
                >

            <LinearLayout android:id="@+id/my_layout"
                    android:layout_height="fill_parent"
                    android:orientation="horizontal"
                    android:layout_width="wrap_content" 
                    >

 
            <Button android:text="@string/home"
             android:drawableTop="@drawable/back_home"
              android:layout_width="wrap_content"
                android:layout_height="wrap_content"
               android:id="@+id/repoHome"
                android:textSize="8sp" 
                 android:layout_marginRight="3dip"/>
                                
               
            <Button android:text="@string/back" 
            android:drawableTop="@drawable/back_icon"
             android:layout_width="wrap_content"
    android:layout_height="wrap_content"
              android:id="@+id/repoBack"
                android:textSize="8sp" 
               android:layout_marginRight="3dip"/>
              
            <Button android:text="@string/refresh"
             android:drawableTop="@drawable/refresh_icon" 
             android:layout_width="wrap_content"
              android:layout_height="wrap_content" 
              android:id="@+id/repoRefresh"
                android:textSize="8sp" 
               android:layout_marginRight="3dip"/>
       
       
       
        </LinearLayout>
        </HorizontalScrollView>
       

 <LinearLayout android:orientation="vertical"
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content"
                android:id="@+id/listing"
                >


       <ListView
                    android:id="@+id/android:list"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    />
      
</LinearLayout>
 </LinearLayout>

Geändert von xben89 (24.08.2011 um 13:49 Uhr)
xben89 ist offline   Mit Zitat antworten
Antwort

Stichworte
-

Themen-Optionen
Ansicht


Ähnliche Themen

Thema Autor Forum Antworten Letzter Beitrag
App kann nicht installiert werden, keine Daten werden angezeigt TaYy Android Allgemein 4 31.07.2011 01:27
Flipout: Kontakte können gesucht werden, werden aber nicht angezeigt dwhh Motorola Flipout Forum 14 26.07.2011 00:49
[Erledigt] Google Konto statt Name wird E-mail Adresse angezeigt? selim Samsung Galaxy S (I9000) Forum 5 11.01.2011 22:00
Auf einmal QWERTY statt QWERTZ diddsen HTC Desire Z Forum 2 30.12.2010 02:33
Klingelton wird nur einmal wiederholt moritzm Samsung Galaxy Spica (I5700) Forum 4 06.09.2010 20:48




Du liest gerade: "Buttons werden statt einmal, für jedes Listen Element wiederholt angezeigt" unter "Android App Entwicklung" auf Android-Hilfe.de.


Powered by vBulletin®
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO
© Android-Hilfe.de 2012 - All rights reserved.