Ich habe eine TextView. Ich möchte alle TextView (Nr.123 ... & Sea View ...) nach links ausrichten. Ich weiß android:gravity="left"
android:layout_gravity="left"
, aber es ist nicht für mein Problem geeignet.Wie richtet man alle TextView in Android?
Hier ist mein xml-Code;
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Address " />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="No.123, Blah Street, Blah Township, Blah Country" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Type "/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sea View, Graden View, Local" />
</LinearLayout>
</LinearLayout>
Wie es mit linker Textansicht ausrichten? Wie unten bild.
Output Ergebnis;
was ist Ihre Ausgabe? kannst du Screenshots teilen? und bitte aktualisieren Sie das übergeordnete Layout von LinearLayout in Ihrem Code-Snippet –
zeigen Sie irgendwie, was Sie bewegen möchten, und in welcher Richtung. Es ist nicht klar. –
siehe unten http://Stackoverflow.com/a/42641608/3513479 keine Notwendigkeit, ändern Sie Ihren Code nur eine Zeile setzen –