Ich möchte ein ImageView
, 2 TextViews
und ein Rating Bar
in einem Knoten in benutzerdefinierte Liste Adapter angezeigt werden, aber es es beschneiden, wenn ich den Code hier ist der XML-Code von benutzerdefinierten Liste Here is the picture of listAndroid: Wie kann man benutzerdefinierte Listenansichten anpassen?
custom_list.xml
laufen?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableRow>
<ImageView
android:id="@+id/img"
android:layout_width="50dp"
android:layout_height="50dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Name"
android:id="@+id/tv_name"
android:layout_column="2" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/tv_deal"
android:layout_column="2"
android:text="deals" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<RatingBar android:id="@+id/rb_rating"
android:layout_column="2" />
</TableRow>
Gründe, warum Sie 'TableLayout' statt' RelativeLayout' verwenden? ... es scheint auch, dass das Problem nicht hier ist, aber im Layout, wo Sie eine Listenansicht haben – Selvin
Ist Relative Layout wie folgt in benutzerdefinierten Layout? – SFAH
ja es funktioniert. Veröffentlichen Sie Ihr Listview- oder Recyclerview-Layout –