Ich versuche, ein ImageView mit 4 textView anzuzeigen. "Titel" "Zeiten" "Alter" und "Informationen". Alle von ihnen sind im globalen horizontalen Layout. Und die 4 TextView sind in einem vertikalen Layout. Die Sache ist, dass ich "Zeiten" und "Alter" in derselben Zeile haben möchte. Aber es kann nicht mit einem vertikalen Layout sein. Hier ist mein xml-Code:Wie kann ich zwei TextView auf einer Linie in einem vertikalen Layout platzieren
<?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="horizontal" >
<ImageView
android:id="@+id/imgLink"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Titre"
android:textSize="8sp"
android:textStyle="bold" />
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="8sp"
android:text="age" />
<TextView
android:id="@+id/age"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="8sp"
android:text="age" />
<TextView
android:id="@+id/information"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:textSize="8sp"
android:text="phrase" />
</LinearLayout>
Dank
Warum kann nicht eine weitere LinearLayout mit Android: Orientation = "horizontal" oder relative Layuot? –
@DheereshSingh Wenn Sie die Breite des übergeordneten Elements überschreiten, wird es nicht in die nächste Zeile umgebrochen. –