private LinearLayout activity_view = null;

// 获得一个可扩展的layout实例
private LayoutInflater inflater = null;

activity_view = (LinearLayout) findViewById(R.id.activity_view);

inflater = (LayoutInflater) MainActivity.this
.getSystemService(LAYOUT_INFLATER_SERVICE);

 

// 将layout添加到view
View view = inflater.inflate(mLayout, null);
activity_view.addView(view);

相关文章:

  • 2022-12-23
  • 2022-02-02
  • 2021-06-02
  • 2021-04-25
  • 2021-05-22
  • 2021-11-30
  • 2021-12-02
  • 2021-12-02
猜你喜欢
  • 2022-12-23
  • 2022-02-11
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
相关资源
相似解决方案