关于将XML布局实例化view的对象写法

实例化为View对象1:

LayoutInflater inflater = (LayoutInflater)context.getSystemService
(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout layout = (LinearLayout)inflater.inflate(R.layout.list_item,null);
实例化为View对象2:
LinearLayout layout = (LinearLayout)LayoutInflater.from(context).inflate
(R.layout.list_item,null);
实例化为View对象3:
LinearLayout layout = (LinearLayout)View.inflate(context,R.layout.list_item,null);
实例化为View对象4:

LayoutInflater inflater =getLayoutInflater().inflate(R.layout.list_item,null);

附上参考网址:http://www.2cto.com/kf/201205/131136.html

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念