方法如下:

               LayoutInflater flater= LayoutInflater.from(getContext());
                //R.layout.title处填写目标布局
               final View view=flater.inflate(R.layout.title,null);
               //以获取一个EditView为例
               EditText edit=(EditText)view.findViewById(R.id.edit);

 

相关文章:

  • 2022-12-23
  • 2021-12-15
  • 2022-12-23
  • 2021-10-16
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-13
  • 2022-12-23
  • 2021-06-01
  • 2021-07-21
  • 2022-12-23
  • 2021-07-30
  • 2022-12-23
相关资源
相似解决方案