问题
I want to make my cardview totally transparent in browse fragment .But the problem is this default shadow type effect is coming.I have tried everything but its not going away.Anyway it can be removed.
CustomImageCardview cardView = new CustomImageCardview(mContext);
cardView.setFocusable(true);
cardView.setFocusableInTouchMode(true);
cardView.setElevation(0);
cardView.setBackgroundColor(ContextCompat.getColor(mContext , R.color.transperent_color));
cardView.invalidate();
Thanx
回答1:
CardView has default elevation which is why shadow is displaying. Override that using cardElevation
property.
app:cardElevation="0dp"
回答2:
Try cardView.setCardElevation(0)
来源:https://stackoverflow.com/questions/38697575/making-imagecardview-in-browse-fragment-totally-transparent