Making ImageCardview in browse fragment totally transparent

老子叫甜甜 提交于 2019-12-07 23:43:02

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!