美文网首页Android面试基础
inflate(resId,root,attachToRoot)

inflate(resId,root,attachToRoot)

作者: 我是吸血鬼 | 来源:发表于2016-03-19 17:12 被阅读35次

1、inflate(resId,root,false)
此时resId中的参数layout_*生效

2、inflate(resId,root,true)
在Adapter中getView()的情况下会出错

3、inflate(resId,null,false)==inflate(resId,null,true)
此时,resId中的layout_*无效

一般使用到第一种情况的时候比较多,想要了解真正的内幕请去翻看源代码。动手实验一番,看别人的也不一定靠谱。

相关文章

网友评论

    本文标题:inflate(resId,root,attachToRoot)

    本文链接:https://www.haomeiwen.com/subject/emmhlttx.html