这里是我的.xml布局文件的片段:填充滚动型与TextViews,Android的Eclipse的
<ScrollView
android:layout_width = "match_parent"
android:layout_height = "300dp" >
<TextView
android:id="@+id/statementdatetv"
android:layout_width="61dp"
android:layout_height="300dp"
android:text="DATE"
android:textSize="10dp" />
<TextView
android:id="@+id/statementlocationtv"
android:layout_width="95dp"
android:layout_height="300dp"
android:text="LOCATION" android:textSize="10dp"/>
<TextView
android:id="@+id/statementshoptypetv"
android:layout_width="95dp"
android:layout_height="300dp"
android:text="SHOPTYPE" android:textSize="10dp"/>
<TextView
android:id="@+id/statementpricetv"
android:layout_width="fill_parent"
android:layout_height="300dp"
android:text="PRICE" android:layout_weight="1" android:textSize="10dp"/>
</ScrollView>
</LinearLayout>
了滚动内的TextViews是从SQL数据库填充。在ScrollView添加之前一切正常,但之后它只是出现了一个错误?
不幸的是,我不知道是哪一个错误,是不是可以从一个SQL数据库中填充值到ScrollView中的TextView中?
我想拥有一个ScrollView的原因是因为可以输出大量的数据,并且我希望它全部在同一个页面上,因此ScrollView是完美的(或者我想的)解决方案!
谢谢!
感谢您的帮助,认识到它,如果你简单的设置来实现的TextViews的高度为“wrap_content”,显然允许高度增加,因此ScrollView被用作输出行数增加! – 2012-04-05 16:49:54