If you want them to overlap, don't put them in a linear layout, which explicitly places them next to each other. You'll probably want to use a frame layout, possibly a relative layout (or implement your own layout) depending on what you are trying to do.
On Fri, Sep 4, 2009 at 9:46 AM, Long <[email protected]> wrote: > > I want to overlap two imageView. > I tried View.offsetLeftAndRight, but it does not work. > My code is as below: > ------ > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/ > android" > android:orientation="horizontal" android:layout_width="320px" > android:gravity = "bottom" > android:id = "@+id/xxx" > android:layout_height="200px"> > > <ImageView xmlns:android="http://schemas.android.com/apk/res/android" > android:layout_width="wrap_content" > android:layout_height="wrap_content" > > > android:src = "@drawable/test1" > android:id = "@+id/image1"/> > > <ImageView xmlns:android="http://schemas.android.com/apk/res/ > android" > android:layout_width="wrap_content" > android:layout_height="wrap_content" > > android:src = "@drawable/test2" > android:id = "@+id/image2"/> > > </LinearLayout> > ---- > in onCreate: > ImageView i = (ImageView)findViewById(R.id.image2); > i.offsetLeftAndRight(-100); > > > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

