Вам необходимо добавить «LinearLayout» (или «RelativeLayout») внутри ScrollView.
Скажем, у вас есть макет XML следующим образом:
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/linearlayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
</LinearLayout>
</ScrollView>
И теперь вы хотите добавить TextView программно, а именно:
LinearLayout linearLayout =(LinearLayout) this.findViewById(R.id.linearlayout1);
for (Quotation quotation : object.quotes){
TextView quote = new TextView(this);
quote.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
quote.setPadding(4, 0, 4, 0); //left,top,right,bottom
quote.setText(quotation.getQuote());
linearLayout.addView(quote);
}