I am using LucasR TwoWayView. I want the View to have 2 rows and multiple columns.
Like the 4th Image in this picture except with 2 rows instead of 3. I tried many things but no use.
Here is my Layout:
<?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>
This is the Gradle Compilation:
compile 'org.lucasr.twowayview:twowayview:0.1.4'
But its not at all displaying 2 rows. Instead coming one single row with all the items. Please help.
<?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>
Use Horizontal orientation for inner LinearLayout
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With