Android : Android: Negative margin top does not work

on Saturday, April 18, 2015


I create RelativeLayout and use 2 images


I use margin-top:-1; but not work



XML code :




<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:layout_marginTop="6dp"
android:layout_weight="0.5"
android:background="@drawable/bg_white_new"
android:orientation="vertical"
android:padding="3dp" >

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<ImageView
android:id="@+id/ImageView05"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/post" />

<ImageView
android:id="@+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/like" android:layout_marginTop="-1dp"/>

</RelativeLayout>

</LinearLayout>

0 comments:

Post a Comment