У меня возникли проблемы с прокруткой GridLayout по горизонтали.
Я нашел аналогичный вопрос Gridlayout + ScrollView. Я пробовал этот метод, но он не работал.
Он вырезает много таблиц (потому что должен был отображать все таблицы от 1 до 20).
Вот xml-файл
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:padding="16dp" >
<android.support.v7.widget.GridLayout
android:id="@+id/table_mapGrid"
android:layout_width="250dp"
android:layout_height="wrap_content" />
</LinearLayout>
</ScrollView>
<include layout="@layout/cell_list_loading" />
<TextView
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" />
</FrameLayout>
Я хочу отображать динамический контент, изменяя количество столбцов и строк, возможно, с пустыми пространствами между таблицами. Этого я добился, но проблема в том, что когда ширина GridLayout становится больше ширины его контейнера, я хотел решить эту проблему с помощью горизонтальной прокрутки, но, похоже, это не работает...
Любое предложение?