三金兄的自留地儿

导航

2011年8月2日 #

LayoutInflater的inflate函数用法

摘要: LayoutInflater作用是将layout的xml布局文件实例化为View类对象。获取LayoutInflater的方法有如下三种:LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);View layout = inflater.inflate(R.layout.main, null);LayoutInflater inflater = LayoutInflater.from(context); (该方法实质就是第一种方法,可参考源代码)View 阅读全文

posted @ 2011-08-02 16:16 三金兄的自留地儿 阅读(14503) 评论(0) 推荐(1) 编辑