我需要动态创建FrameLayouts并将动态的特定片段设置为布局。我们可以在android studio中做到吗?
for (int i = 0; i < list.size(); i++)
{
User current_user = list.get(i);
UserFragment current_user_fragment = new UserFragment(current_user);
FrameLayout current_frame_layout = new FrameLayout(getContext());
// then I need to the current_user_fragment into the current_frame_layout here
}
注意:
我正在尝试动态创建以下XML层次结构;
-LinearLayout
-LinearLayout
-FrameLayout
-FrameLayout
-FrameLayout
-FrameLayout
-LinearLayout
-FrameLayout
-FrameLayout
-FrameLayout
-FrameLayout
.
.
.