How to layout view right aligned and bottom of an LinearLayout

Posted by michael on Stack Overflow See other posts from Stack Overflow or by michael
Published on 2010-04-18T21:38:38Z Indexed on 2010/04/18 21:43 UTC
Read the original article Hit count: 313

Filed under:

Hi

I am trying to layout 1 textview (upText) left aligned and 1 textview (downText) and an image view (image) both on the same line and right aligned.

how can I do that? I tried that, but both 'textview' and image view at left aligned.

        <TextView
            android:id="@+id/uptext"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="left"/>
        <TextView
            android:id="@+id/downtext"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:singleLine="true"
            android:gravity="right|bottom"/>
        <ImageView
            android:id="@+id/image"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="right|bottom"/>
    </LinearLayout>

© Stack Overflow or respective owner

Related posts about android