android:layout_alignParentRight is an attribute for use with
RelativeLayout, not LinearLayout. Try android:layout_gravity="right".

I apologize for not noticing this in your earlier post.

On Sun, Jul 4, 2010 at 8:02 PM, cindy <[email protected]> wrote:
> After I change to android:layout_width="wrap_content", the image is
> show up at the left of screen. Before that, it is show at the center
> of screen,
>
> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
> android"
>                android:layout_width="fill_parent"
>                android:id="@+id/logo_block"
>                android:padding="10px"
>        android:layout_height="wrap_content">
>                <ImageView
>                        android:layout_width="wrap_content"
>                        android:layout_height="fill_parent"
>                        android:gravity="right"
>                        android:layout_alignParentRight="true"
>                        android:src="@drawable/logo_poweredby"/>
>        </LinearLayout>
>
> On Jul 4, 2:09 pm, Mark Murphy <[email protected]> wrote:
>> On Sun, Jul 4, 2010 at 4:55 PM, cindy <[email protected]> wrote:
>> > In the linearlayout, I need to put the image at right. I have tried a
>> > lot of method, none of them works. Can someone point out what is
>> > wrong?
>>
>> > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
>> > android"
>> >                android:layout_width="fill_parent"
>> >                android:id="@+id/logo_block"
>> >                android:padding="10px"
>> >        android:layout_height="wrap_content">
>> >                <ImageView
>> >                        android:layout_width="fill_parent"
>> >                        android:layout_height="fill_parent"
>> >                        android:gravity="right"
>> >                        android:layout_alignParentRight="true"
>> >                        android:src="@drawable/logo_poweredby"/>
>> >        </LinearLayout>
>>
>> You have said that the ImageView should fill up the width of the
>> LinearLayout. That is probably not what you want. Make
>> android:layout_width="wrap_content".

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Consulting: http://commonsware.com/consulting

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to