Android面试基础

inflate(resId,root,attachToRoot)

2016-03-19  本文已影响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_*无效

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

上一篇 下一篇

猜你喜欢

热点阅读