Невозможно сделать двухстороннее представление с двумя строками

Я использую LucasR TwoWayView. Я хочу, чтобы представление имело 2 строки и несколько столбцов.

введите описание изображения здесь

Как и 4-е изображение на этом снимке, за исключением двух строк вместо 3. Я пробовал много вещей, но не использовал.

Вот мой макет:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <LinearLayout
        android:id="@+id/categoryItems"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:visibility="visible">

        <org.lucasr.twowayview.TwoWayView
            android:id="@+id/filterGrid"
            style="@style/TwoWayView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/margin_small"
            android:drawSelectorOnTop="false"
            app:twowayview_numRows="3"
            app:twowayview_layoutManager="GridLayoutManager" />


    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="#d3d3d3" />

</LinearLayout>

Это Gradle Компиляция:

compile 'org.lucasr.twowayview:twowayview:0.1.4'

Но это вовсе не отображает 2 строки. Вместо этого появляется одна строка со всеми элементами. Пожалуйста, помогите.

Ответы

Ответ 1

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <LinearLayout
        android:id="@+id/categoryItems"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:visibility="visible">

        <org.lucasr.twowayview.TwoWayView
            android:id="@+id/filterGrid"
            style="@style/TwoWayView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/margin_small"
            android:drawSelectorOnTop="false"
            app:twowayview_numRows="3"
            app:twowayview_layoutManager="GridLayoutManager" />


    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="#d3d3d3" />

</LinearLayout>

Используйте горизонтальную ориентацию для внутреннего LinearLayout