南小爵

站在巨人肩膀上看风景。
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2014年2月7日

摘要: 在实际开发种LayoutInflater这个类还是非常有用的,它的作用类似于findViewById(),不同点是LayoutInflater是 用来找layout下xml布局文件,并且实例化!而findViewById()是找具体xml下的具体widget控件 (如:Button,TextView等)。 获取LayoutInflater的方法有如下三种: 第一种:1 LayoutInflater inflater = LayoutInflater.from(this); 2 View layout = inflater.inflate(R.layout.main, null); Vie... 阅读全文

posted @ 2014-02-07 09:35 南小爵 阅读(191) 评论(0) 推荐(0)