create your layouts as follows:
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/llTitle"
android:background="#ffffff"
android:gravity="center">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Title">
</LinearLayout>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FF00FF">
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/customshape"
amdroid:id="@+id/llContainer"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="button"
android:id/button1"/>
</LinearLayout>
</LinearLayout>
customshape.xml:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="#SomeGradientBeginColor" android:endColor="#SomeGradientEndColor"
android:angle="270"/>
<corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp"
android:topLeftRadius="7dp" android:topRightRadius="7dp"/>
</shape>
row.xml
//create rox.xml to contain a textview and a spinner.
in your activity loop to add views to llContainer
LinearLayout llContainer=(LinearLayout)findViewById(R.id.llContainer);
for(int i0;i<list.size();i++)
{
LinearLayout llView=inflater.inflate(R.layout.row, null);
//set attributes of textview and spinner
llContainer.addView(llView);
}