Eugene
Eugene

Reputation: 60184

How to overlap two Views which are located one below another?

I have two Views which reside one below another and I need to slightly overlap their edges so the bottom one was slightly under the top one.

Upvotes: 1

Views: 69

Answers (2)

Tomer Mor
Tomer Mor

Reputation: 8028

use marginTop and set to -dp

           <ImageView
            android:id="@+id/1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

            <ImageView
            android:id="@+id/2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/1"
            android:layout_marginTop="-2dp"/>

Upvotes: 1

James
James

Reputation: 3749

Use a negative layout_margin.

Upvotes: 0

Related Questions