Android LayoutInflater的几种获得方式

几种获得LayoutInflater的方式适用范围有所不同,具体参考SDK:

LayoutInflater inflater1 = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
LayoutInflater inflater2 = LayoutInflater.from(this);
LayoutInflater inflater3 = getLayoutInflater();

至于用LayoutInflater做什么,就不罗嗦了哦!:)

猜你喜欢

转载自wangleyiang.iteye.com/blog/1777629