views:

55

answers:

1

Hi guys, i want to achieve this kinda of row look in my app.

I already have a ImageView/TextView layout, but i want that 'positive' little image in the right always being displayed at the exact same place!

Thanks!

+2  A: 

Probably by using gravity will do the job

android:layout_gravity="center_vertical|right"

See this sample taken from one of my views

<LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/LinearLayout01"
        android:gravity="center_vertical"
        android:orientation="horizontal">
        <LinearLayout
            android:layout_width="0dip"
            android:layout_weight="1"
            android:paddingRight="8dip"
            android:layout_height="wrap_content"
            android:id="@+id/LinearLayout01"
            android:orientation="vertical">
        ....
        </LinearLayout>
        <ImageView
            android:id="@+id/imgArrowRight"
            android:src="@drawable/tab_right_arrow"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="10dip"
            android:layout_gravity="center_vertical|right"></ImageView>
    </LinearLayout>
Pentium10
I'm gonna try it!
Philipz
Pentium10, it worked :D Except that i used android:orientation="horizontal" in both LinearLayout's. A BIG THANK YOU :)
Philipz