要在ScrollView中填充LinearLayout,可以按照以下步骤进行:
LinearLayout linearLayout = findViewById(R.id.linear_layout);
for (int i = 0; i < 10; i++) {
TextView textView = new TextView(this);
textView.setText("Item " + i);
linearLayout.addView(textView);
}
以上代码将在LinearLayout中添加10个TextView作为子视图。
这样,你就可以在ScrollView中填充LinearLayout了。