标签:res lan href 解决 ESS tar com class code
今天使用LayoutInflate.inflate()方法加载一个布局,当参数root 为null 时,出现下列提示
Avoid passing null as the view root (needed to resolve layout parameters on the inflated layout‘s root element)
解决方案:
1. 添加:
@SuppressLint("InflateParams")
2. 修改成
view = View.inflate(context,R.layout.custom_layout,null);
改用View的inflate方法root为null就不会出现warning提示。
LayoutInflate: Avoid passing null as the view root
标签:res lan href 解决 ESS tar com class code
原文地址:https://www.cnblogs.com/yongdaimi/p/12166138.html