`
骞子_Isaac
  • 浏览: 7904 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

获取其他布局文件中的控件方法

 
阅读更多

如何获取其他布局文件中的控件呢?很简单,android已经有封装好的方法了:

LayoutInflater factorys = LayoutInflater.from(WelcomeActivity.this);
final View buttonEntryView = factorys.inflate(R.layout.welcome_item03, null);
Button button = (Button) buttonEntryView.findViewById(R.id.btn_welcome);

 

 先找到是哪一个布局文件,然后通过布局文件来找控件就OK了!

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics