Ich versuche (vergeblich), Ränder zu meinen ListView-Elementen hinzuzufügen. Ich habe versucht, meinem RelativeLayout unten Randwerte hinzuzufügen, aber egal was ich tue, alles, was ich zu bekommen scheint, ist eine 1px Linie zwischen jedem Gegenstand.Marge auf ListView Artikel in Android
Was ich wirklich gerne hätte, ist abgerundete Ecken auf jedem Artikel, ein 1px schwarzer Rand und ein 3-5px Rand links, oben und rechts, aber jetzt begnüge ich mich mit nur einem Rand um jeden Gegenstand: -)
Wie erreiche ich meine Ziele? Nur der Spielraum für jetzt ... ;-)
Hier ist, was ich habe:
UPDATE: ich die xml unter Entfernen Haupt Layout und Fragment-Layout aktualisiert haben. Ich habe auch das Layout des ListView-Elements auf das aktualisiert, was ich jetzt habe, was näher an dem ist, was ich möchte, aber immer noch nicht perfekt. Screenshot hinzugefügt sowie
Listview-Element Layout xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/matchMargin"
android:paddingRight="@dimen/matchMargin"
android:paddingTop="@dimen/matchMargin" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#cfcfcfcf" >
<include
android:id="@+id/matchKampstart"
layout="@layout/kampstart_layout" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/matchKampstart"
android:layout_marginTop="@dimen/belowKampstartMargin" >
<ImageView
android:id="@+id/tournamentImageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="2dp"
android:adjustViewBounds="true"
android:contentDescription="@string/tournamentImageViewContentDescription"
android:gravity="left"
android:src="@drawable/sofabold_launcher" />
<ImageView
android:id="@+id/homeTeamImageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="2dp"
android:adjustViewBounds="true"
android:contentDescription="@string/homeTeamImageViewContentDescription"
android:src="@drawable/sofabold_launcher" />
<TextView
android:id="@+id/homeTeam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="2dp"
android:text="@string/home"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="@+id/dash"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="2dp"
android:gravity="center"
android:text="@string/dash"
android:textSize="12sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/awayTeamImageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="2dp"
android:adjustViewBounds="true"
android:contentDescription="@string/awayTeamImageViewContentDescription"
android:src="@drawable/sofabold_launcher" />
<TextView
android:id="@+id/awayTeam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center"
android:text="@string/away"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@id/matchKampstart"
android:layout_marginTop="@dimen/belowKampstartMargin" >
<ImageView
android:id="@+id/tvChannelImageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="false"
android:contentDescription="@string/tvChannelImageViewContentDescription"
android:gravity="right"
android:src="@drawable/sofabold_launcher" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
Das gibt mir die folgenden, wo man eine sehr kleine Linie nach rechts auffallen wird, und für jede Position links. Das würde ich auch gerne loswerden.
Haben Sie Marge oder padding wollen? – Sam
Erstellen abgerundete Ecken und eine Grenze ist nicht zu schwer, diese [Developer's Guide] (https://developer.android.com/guide/topics/resources/drawable-resource.html#Shape) erklärt einige der Details. – Sam
Ich will Marge. Ich möchte meine Listenelemente trennen. – CJe