几种获得LayoutInflater的方式适用范围有所不同,具体参考SDK:
LayoutInflater inflater1 = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
LayoutInflater inflater2 = LayoutInflater.from(this);
LayoutInflater inflater3 = getLayoutInflater();
至于用LayoutInflater做什么,就不罗嗦了哦!:)
LayoutInflater获取方式
本文介绍了三种不同的LayoutInflater获取方式:通过getSystemService、LayoutInflater.from以及直接调用getLayoutInflater方法,并指出了它们适用的不同场景。
916

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



