[Problem gelöst] Ich weiß nicht, warum die Höhe: wrap_content nicht funktioniert, wie ich erwartet habe, änderte ich es einfach, um Eltern zu entsprechen. Wie auch immer, Problem gelöst. Ich möchte nicht mehr Zeit mit diesem komischen Ding verbringen.android LinearLayout Anzeige Problem
Ich verwende LinearLayout, um das CardView zu erstellen. Ich bekomme jedoch diese seltsame Situation. Jinesh Francis Code funktioniert perfekt, aber wenn ich die Konfiguration in meinen Code kopiere und einfüge, bleibt das Problem gleich.
Warum angezeigt nicht, kann der lange Titel vollständig?
ist das Layout wie folgt:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="@+id/movieCardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_gravity="center"
android:background="@color/bacgroundCardView">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/movieImage"
android:layout_width="70dp"
android:layout_height="90dp"
android:layout_marginBottom="4dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginTop="4dp"
android:scaleType="fitXY"
android:src="@drawable/selfie" />
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp">
<TextView
android:id="@+id/movieTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="8"
android:textSize="15dp"
android:textColor="#000"
android:textStyle="bold"
android:text="Long long long long long long long long Title"/>
<TextView
android:id="@+id/movieRating"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.7"
android:textSize="12dp"
android:textStyle="bold"
android:text="7.0" />
<CheckBox
android:id="@+id/checkBox"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:scaleX="0.70"
android:scaleY="0.70" />
</LinearLayout>
<TextView
android:id="@+id/movieDescription"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textSize="10dp"
android:text="So many many many many many many many many many many many many description" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
Vielen Dank für jede Anregung
Es ist nicht genug, um nur die XML-Tags zu schreiben. Bearbeiten Sie Ihren Post und fügen Sie die Attribute hinzu. – Karakuri
posten Sie Ihre komplette Layout-Datei –
Sie verwenden LinearLayout in relativeLayout, und Einstellung Gewicht des Titels .. deshalb gibt es diese Ausgabe – NehaK