I have, didn't work though. I eventually changed tracks and solved it with a RelativeLayout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="10dip"> <TextView android:id="@+id/list_item_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" /> <LinearLayout android:id="@+id/list_item_rating" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:orientation="horizontal" android:gravity="right" > <ImageView android:layout_width="16dip" android:layout_height="15dip" android:src="@drawable/foo" android:contentDescription="@string/accessibility_foo" /> </LinearLayout> <!-- below name & rating --> <TextView android:id="@+id/list_item_review_message" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/list_item_rating" android:layout_alignParentLeft="true" android:layout_alignParentBottom="true" /> </RelativeLayout> This blogpost helped me realise that right aligning within a horizontal linearlayout wouldn't work, not as of now: http://sandipchitale.blogspot.com/2010/05/linearlayout-gravity-and-layoutgravity.html I hope the layout I'm using now is a good one and isn't too bloated. It certainly looks cleaner, a smaller performance footprint would be a bonus :-) Thank you for your time though! On 26 April 2012 16:55, Justin Anderson <magouyaw...@gmail.com> wrote: > Have you tried the android:layout_gravity attribute? > > Thanks, > Justin Anderson > MagouyaWare Developer > http://sites.google.com/site/magouyaware > > > > On Thu, Apr 26, 2012 at 6:59 AM, Niels Delporte > <niels.delpo...@gmail.com>wrote: > >> Hi Romain Guy, >> >> I know this is a very old post, but still wanted to ask you something >> relating to this. >> You see, I want to achieve the same result but wit a TextView and another >> LinearLayout within a LinearLayout. >> I'm experiencing the same problem though. >> >> <LinearLayout >> xmlns:android="http://schemas.android.com/apk/res/android" >> android:layout_width="fill_parent" >> android:layout_height="wrap_content" >> android:orientation="vertical" >> > >> <LinearLayout >> android:layout_width="fill_parent" >> android:layout_height="wrap_content" >> android:orientation="horizontal" >> > >> >> <TextView >> android:id="@+id/name" >> android:layout_width="wrap_content" >> android:layout_height="wrap_content" >> /> >> >> <LinearLayout >> android:layout_width="wrap_content" >> android:layout_height="wrap_content" >> android:orientation="horizontal" >> android:gravity="right" >> > >> >> <ImageView >> android:layout_width="16dip" >> android:layout_height="15dip" >> android:src="@drawable/foo" >> android:contentDescription="@string/accessibility_foo" /> >> >> </LinearLayout> >> >> </LinearLayout> >> >> <TextView >> android:id="@+id/message" >> android:layout_width="fill_parent" >> android:layout_height="wrap_content" >> android:layout_marginTop="10dip" >> /> >> >> </LinearLayout> >> >> Can you see why my inner LinearLayout doesn't want to anchor to the >> outmost rigt? >> >> Thank you in advance! >> >> Niels >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to android-developers@googlegroups.com >> To unsubscribe from this group, send email to >> android-developers+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en > > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en