Remove background from ImageCardView
Asked Answered
C

2

1

I started using new android.support.v17.leanback library and have some trouble in styling ImageCardView.

I am changing the image on ImageCardView to have a different shape so I would like to remove background and shadow which are automatically generated when using the card in ListRow for example. If I leave the shadow, my card looks weird because shadow and background are showing like the card is square.

I've tried to set the different background to all the elements but it doesn't work. If I set the normal background color (green, blue, etc), the background of the image or info area would change but if I set the transparent background, another background which wraps the whole card would be visible.

Any ideas how to solve this issue?

Carnotite answered 14/4, 2016 at 13:16 Comment(2)
Post your relevant code here.Shiloh
@Carnotite Did you manage it to use a transparent background?Wafture
W
6

Your problem is not about the CardView itself, it's about your presenter. Put this line your RowPresenter/ListRowPresenter:

listRowPresenter.setShadowEnabled(false);

Furthermore, in this Medium article you can see how to make you CardView circular. And where it shows how to remove the shadow when the row is not focused, overriding the isUsingDefaultListSelectEffect() method to be always false.

Wafture answered 27/2, 2017 at 16:34 Comment(0)
M
-1

According to this post, you cannot change the background drawable, only the color.

You can try

public void setBackground (Drawable background)
-Set the background to a given Drawable, or remove the background
Malik answered 15/4, 2016 at 10:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.