如何找到活动的根视图,然后在底部添加框架布局?相反,下面的代码添加到顶部,但不能添加到底部。
FrameLayout aLayout = new FrameLayout(getActivity());
aLayout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
ImageView image = new ImageView(getActivity());
image.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
image.setImageResource(R.drawable.alayer_0);
adLayout.addView(image);
ViewGroup content = (ViewGroup) getActivity().findViewById(android.R.id.content);
content.addView(aLayout);