一 描述
最近项目中有一个view要覆盖到另外的背景上面,但是发现一直被挡住如图。


拿到原图的时候 想到的是 item项用相对布局。可是开发后发现,加号部分一直被挡住,相对布局怎么会被挡呢,
原因:
蓝色区域是一个cardview,加号为imageview,通过查找各种资料,后面发现,当在RelativeLayout 下使用card view的时候 如果不想cardview覆盖到另外的view(这里是imageview),
解决方案:
RelativeLayout下,其他view也要使用另外一个cardview包裹,即imageview加一层card view包裹,这样imageview 就不会被card view挡住。


网友评论