在项目中使用linearLayout.removeAllViews()没效果,原有view作为背景显示。
content_ll.removeAllViews();
content_ll.setBackgroundResource(0);
content_ll.invalidate();
清空LinearLayout 背景即可解决
本文介绍了一种解决LinearLayout在使用removeAllViews方法后仍显示原有View作为背景的问题。通过调用setBackgroundResource(0)和invalidate()方法可以成功清除背景。
在项目中使用linearLayout.removeAllViews()没效果,原有view作为背景显示。
content_ll.removeAllViews();
content_ll.setBackgroundResource(0);
content_ll.invalidate();
清空LinearLayout 背景即可解决
您可能感兴趣的与本文相关的镜像
Stable-Diffusion-3.5
Stable Diffusion 3.5 (SD 3.5) 是由 Stability AI 推出的新一代文本到图像生成模型,相比 3.0 版本,它提升了图像质量、运行速度和硬件效率

被折叠的 条评论
为什么被折叠?