Android中得到布局文件对象有两种方式
第一种,在Activity所在类中

this.getLayoutInflater().inflater(R.layout.布局文件名,null);

第二种,在非Activity所在类中

Context.getSystemService(Context.LAYOUT_INFLATER_SERVICE).inflater(R.layout.布局文件名,null);

 

相关文章:

  • 2021-11-30
  • 2022-02-27
  • 2021-07-06
  • 2022-12-23
  • 2021-06-08
  • 2021-12-10
  • 2022-12-23
  • 2021-09-29
猜你喜欢
  • 2021-07-15
  • 2022-12-23
  • 2021-12-08
  • 2022-02-27
  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案