如何使用 LayoutInflater
设置布局 View 。这意味着我需要在布局上查看并将其设置在其他布局上
类似这样的事情
LayoutInflater layoutInflater = (LayoutInflater) this.getSystemService(this.LAYOUT_INFLATER_SERVICE);
View v = layoutInflater.inflate(R.layout.activity_strona_glowna,null);
LinearLayout a = findViewById(R.id.MainLayout);
我想在'a'
的 View 上设置layoutInflater
最佳答案
您可以使用 addView() 方法来完成此操作。
a.addView(v);
关于java - 如何设置Layout的View,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56854815/