天天看點

android 橫向滾動 tableview,GridLayout的Android,水準和垂直滾動

我無法讓GridLayout水準滾動.

我發現了一個類似的問題Gridlayout + ScrollView.我嘗試了這種方法,但它沒有用.

它會删除許多表(因為它應該顯示從1到20的所有表).

這是xml檔案

android:layout_width="wrap_content"

android:layout_height="wrap_content" >

android:layout_width="match_parent"

android:layout_height="match_parent" >

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="center_horizontal"

android:padding="16dp" >

android:id="@+id/table_mapGrid"

android:layout_width="250dp"

android:layout_height="wrap_content" />

android:id="@+id/table_errorView"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="center_vertical"

android:layout_marginLeft="20dp"

android:text="@string/message_error_connection"

android:visibility="invisible" />

我希望顯示動态内容,改變列和行的數量,可能在表之間有空格.

我已經完成了,但問題是當GridLayout的寬度變得大于其容器的寬度時,我想用水準滾動來解決它,但它似乎不起作用……

有什麼建議嗎?