我有线性布局,我想将 FrameLayout 膨胀到其中。你知道,它是怎么做到的吗?可能吗?我仍然收到“没有找到适合 Inflate 的方法”的错误
谢谢
编辑:回答自己:
LinearLayout ll=(LinearLayout) findViewById(R.id.linear);
final LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
FrameLayout frml = (FrameLayout)inflater.inflate(R.layout.frame,null);
frml.setId(10101010);
frml.setBackgroundColor(Color.RED);
ll.addView(frml);