Layout gesucht

  • Antworten:4
Sven Bietner
  • Forum-Beiträge: 3

08.06.2014, 12:29:35 via Website

Hallo,

ich möchte eine eigene ListView gestalten. Dabei soll eine Zeile so aussehen:

image

Wie erstelle ich so ein Layout am besten? Soll ich ein GridLayout oder ein TableLayout benutzen? Ich weiß irgendwie nicht weiter. Kann mir jemand helfen?

Danke

Antworten
Gelöschter Account
  • Forum-Beiträge: 2.640

08.06.2014, 12:32:46 via App

Mit einem Listfragment würde das gehen

Ich sammle gerne Namen in meinem Death Note.

Samsung Galaxy Note 2<3 -> Samsung Galaxy Note 3 <3

Antworten
Sven Bietner
  • Forum-Beiträge: 3

08.06.2014, 12:44:05 via Website

Könntest Du deine Antwort etwas genauer beschreiben? Was hat ein Fragement damit zu tun? Ich versuche eine ListView-Zeile zu gestalten. Das Layout übergebe ich dann meinem Adapter.

Danke :)

San Blarnoi

Antworten
Andreas S.
  • Forum-Beiträge: 76

08.06.2014, 15:09:27 via Website

  &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
        android:orientation=&quot;horizontal&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;match_parent&quot;&gt;

        &lt;ImageView android:layout_width=&quot;wrap_content&quot;
                   android:src=&quot;@android:drawable/btn_star&quot;
                   android:layout_height=&quot;wrap_content&quot;/&gt;

        &lt;LinearLayout
            android:layout_width=&quot;wrap_content&quot;
            android:orientation=&quot;vertical&quot;
            android:layout_height=&quot;wrap_content&quot;&gt;

            &lt;TextView
                android:layout_width=&quot;wrap_content&quot;
                android:layout_height=&quot;0dp&quot;
                android:text=&quot;row 1, col1&quot;
                android:layout_weight=&quot;1&quot;/&gt;

            &lt;TextView
                android:layout_width=&quot;wrap_content&quot;
                android:layout_height=&quot;0dp&quot;
                android:text=&quot;row 2, col1&quot;
                android:layout_weight=&quot;1&quot;/&gt;

        &lt;/LinearLayout&gt;

        &lt;LinearLayout
            android:layout_width=&quot;wrap_content&quot;
            android:orientation=&quot;vertical&quot;
            android:layout_height=&quot;wrap_content&quot;&gt;

            &lt;TextView
                android:layout_width=&quot;wrap_content&quot;
                android:layout_height=&quot;0dp&quot;
                android:text=&quot;row 1, col2&quot;
                android:layout_weight=&quot;1&quot;/&gt;

            &lt;TextView
                android:layout_width=&quot;wrap_content&quot;
                android:layout_height=&quot;0dp&quot;
                android:text=&quot;row 2, col2&quot;
                android:layout_weight=&quot;1&quot;/&gt;

        &lt;/LinearLayout&gt;

    &lt;/LinearLayout&gt;

— geändert am 08.06.2014, 15:13:18

Antworten