Das ist, was ich will:Align Image nach oben rechts in einem Linearlayout
[Screenshot]
Hier ist, was ich getan habe:
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="30dip"
android:background="@color/color"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:background="@color/color"
android:orientation="horizontal">
<View
android:id="@+id/divider"
android:layout_width="5dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:background="@color/grey"
android:gravity="center_vertical" />
<LinearLayout
android:id="@+id/llayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color"
android:orientation="vertical" >
<TextView
android:id="@+id/label"
style="@style/some_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="8dp"
android:gravity="left" />
<TextView
android:id="@+id/label2"
style="@style/some_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="8dp"
android:gravity="left" />
</LinearLayout>
</LinearLayout>
</merge>
Ich habe getan, fast, aber das Problem ist, wie man das Bild rechts oben auf einem vertikalen linearen Layout ausrichten kann (siehe Screenshot).
Auch ich habe versucht mit Relative Layout, Bild kommt oben rechts, aber es schneidet meinen Text in der Textansicht.
Bitte machen:
es funktioniert der Trick aber am Anfang gibt es eine einzeilige Raum tht Ich will nicht. kannst du bitte helfen. Ich möchte ersten Text in der linken und Bild in der rechten – user6434454
für das müssen Sie Relative Layout –
alignParent = "links" für Textansicht und alignPatent = "rechts" für Bildansicht verwenden –