1
Ich habe meinen Bildschirm, der in den 4 Teilen vertikal unterteilt ist und ich möchte vertikalen Text in allen 4 Streifen, versuchte ich mit android:rotation="-90"
, aber wenn mein Text lang ist, erscheint es in den 2 Zeilen. Wie kann ich es nur in 1 Zeile machen.Vertikale Texview
Ich möchte DELHI AGRA in nur Linie
Es folgt mein xml Layout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:baselineAligned="false"
android:weightSum="4"
android:layout_below="@+id/offers_view">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/first"
android:background="#CC4D9E59"
android:layout_weight="1"
android:weightSum="1">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/one"
android:text="Delhi Agra"
android:textSize="@dimen/textsize_xxxmedium"
android:textColor="@color/white"
android:textAllCaps="true"
android:rotation="-90"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/second"
android:background="#CC9C27B0"
android:layout_weight="1">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Goa"
android:id="@+id/two"
android:textSize="@dimen/textsize_xxxmedium"
android:textColor="@color/white"
android:textAllCaps="true"
android:gravity="center"
android:rotation="-90"
android:layout_gravity="bottom|center_vertical"
android:layout_marginBottom="@dimen/margin_lmedium"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/third"
android:background="#CC2196F3"
android:layout_weight="1">
<TextView
android:layout_width="85dp"
android:layout_height="match_parent"
android:id="@+id/three"
android:text="Delhi"
android:textSize="@dimen/textsize_xxxmedium"
android:textColor="@color/white"
android:textAllCaps="true"
android:gravity="center"
android:rotation="-90"
android:layout_gravity="top|center_horizontal"
android:layout_marginTop="@dimen/margin_lmedium"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/fourth"
android:background="#CCFF9800"
android:layout_weight="1">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/view_all_cities"
android:text="@string/view_all_cities"
android:textSize="@dimen/textsize_xxxmedium"
android:textColor="@color/white"
android:textAllCaps="true"
android:rotation="-90"
android:gravity="center"
android:layout_gravity="center_vertical"
android:layout_marginTop="@dimen/margin_lmedium"/>
</LinearLayout>
</LinearLayout>
Funktioniert 'android: singleLine =" true "' nicht? –
Nein, nach dem Hinzufügen wird nur DELHI angezeigt –
Und hast du die Breite auf 'wrap_content' gesetzt? –