Reputation: 2615
i have an imageView on screen and i want to put another imageview that will appear in the bottom of the imageView (It is just like a little line), i align the line with the main imageView the problem is that it left a little margin between the main imageView and the line,
In the emulator it align perfect but in the device it let a little margin like paddingbottom and i dont know why
this is the screen
http://s2.subirimagenes.com/otros/previo/thump_8473957photoscreen.jpg
The white zone with the text "Manolo" should be on the bottom but there is a little margin
And there is the Code(is all in a linearLayout vertical)
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/inferior"
android:layout_below="@+id/superior"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:scaleType="fitXY"
android:src="@drawable/ic_launcher" />
<ImageView
android:id="@+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/imageView1"
android:layout_alignBottom="@+id/imageView1"
android:layout_centerHorizontal="true"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:src="@drawable/fondonombretransparencia" />
Upvotes: 0
Views: 173
Reputation: 294
Try using the 'adjustViewBounds' parameter as stated in here:
<ImageView
(...)
android:adjustViewBounds="true" />
If set to true, the ImageView will adjust its bounds to preserve the aspect ratio of its drawable. This might solve the padding difference between your emulator and the physical device.
Upvotes: 1