1

How can I delete this extras margin, I trying with this answers but not work.

enter image description here

My code CardView

< LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android"
xmlns: card_view = "http://schemas.android.com/apk/res-auto"
xmlns: tools = "http://schemas.android.com/tools"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content" >

 < android.support.v7.widget.CardView
android: id = "@+id/cartaExposicion"
android: layout_width = "wrap_content"
android: layout_height = "300dp"
card_view: cardPreventCornerOverlap = "false" >

 < ImageView
android: id = "@+id/imgExposicion"
android: layout_width = "wrap_content"
android: layout_height = "300dp"
android: src = "@mipmap/makuma_0salas" / >
 < /android.support.v7.widget.CardView> < /LinearLayout>

EDIT

I need delete the spacing into cardview

enter image description here

enter image description here

Cœur
  • 37,241
  • 25
  • 195
  • 267
David Hackro
  • 3,652
  • 6
  • 41
  • 61
  • Which extra margin do you mean? Do you mean the spacing that you have between the CardViews? – Knossos Jan 28 '16 at 17:37
  • yes @Knossos it's correct the spacing between the CardViews – David Hackro Jan 28 '16 at 17:43
  • @Knossos sorry, the spacing it's into cardview,how i can delete this spacing? – David Hackro Jan 28 '16 at 18:16
  • It looks like you are setting 300dp for the `ImageView` and `CardView`, but the image that fills it isn't actually 300dp in height. So it does not fill that view. Try setting both `ImageView` and `CardView` to wrap_content for height. Alternatively try setting `ImageView` `scaleType` to `fit`. – Knossos Jan 28 '16 at 18:24

2 Answers2

1

Try giving negative values for card view content padding

card_view:contentPadding="-5dp"

If you want to remove padding unevenly. Try giving different values for contentPaddingLeft, contentPaddingRight,contentPaddingBottom and contentPaddingTop.

Hope this will work for you.

Surya
  • 21
  • 1
  • 3
0

I solved my problem, the size the images it's very big, i use image small and work fine.

Result

enter image description here

David Hackro
  • 3,652
  • 6
  • 41
  • 61