如果您希望动态地将 textview 添加到您的视图中,那么您可以这样做
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:id="@+id/lineralayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
</LinearLayout>
</ScrollView>
在您的活动课程中
LinearLayout l = (LinearLayout) findViewById(R.id.lineralayout1);
while(mNotesCursor.moveToNext()){
TextView tv = new TextView(this);
tv.setText(mNotesCursor.getString(mNotesCursor.getColumnIndex("title")));
l.addView(tv);
}