2010-09-08 79 views

回答

-1

將您的網格視圖換成滾動視圖。

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
      android:id="@+id/scrollview" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:background="#ffffff" 
      android:paddingTop="10dip" 
      android:paddingLeft="5dip" 
      android:layout_weight="1" 
     > 
</ScrollView> 
+5

不要這樣做。 'GridView'已經知道如何滾動。 – CommonsWare 2010-09-08 19:47:02

+2

GridView基本上是一個帶有列的ListView。所有相同的概念都適用。將ListView或GridView放入ScrollView就像試圖用正則表達式解析HTML一樣。你的唯一獎勵將是痛苦和痛苦。 – adamp 2010-09-08 23:06:40

4

我想補充的gridview的滾動條,我怎麼能在網格視圖中添加滾動條?

GridViewGridView已經有一個滾動條,所以沒有什麼是你需要做的。在Android 2.2中,當用戶主動滑動網格時,該條只會默認顯示。您可以使用一系列attributes defined on the View class來定製滾動條的行爲。