I have an Inner relative layout with 2 images, and when I set the android:layout_marginRight
attribute it doesn’t do anything.
Here is my code:
<RelativeLayout
android:id="@+id/location_image_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="80dp" />
<ImageView
android:layout_width="69.33dp"
android:layout_height="72dp"
android:background="@drawable/icon"
android:layout_centerInParent="true" />
</RelativeLayout>
The problem is in the layout’s property
android:layout_width. When it is set to"wrap_content",theandroid:layout_marginRightwon’t working, but rather, only when it is set to"fill_parent", theandroid:layout_marginRightwill work.