android-flowlayout icon indicating copy to clipboard operation
android-flowlayout copied to clipboard

FlowLayout does not work with enclosing ScrollView

Open Spookyguy opened this issue 9 years ago • 2 comments

Hi,

as the title says, i can't get FlowLayout to work with an enclosing Scrollview. XML is like follows:

`<ScrollView android:layout_width="match_parent" android:layout_height="match_parent">

    <org.apmem.tools.layouts.FlowLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#000000"
        android:gravity="fill"
        android:isScrollContainer="true"
        android:orientation="horizontal"
        android:padding="50dp"
        android:scrollbars="vertical">

        <ImageView
            android:id="@+id/katana"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:onClick="openChecklist"
            android:paddingLeft="30dip"
            android:src="@drawable/katana"
            android:tag="tag" />

        <ImageView
            android:id="@+id/etla"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:onClick="openChecklist"
            android:paddingLeft="30dip"
            android:src="@drawable/detla"
            android:tag="tag" />

        <ImageView
            android:id="@+id/embn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:onClick="openChecklist"
            android:paddingLeft="30dip"
            android:src="@drawable/dembn"
            android:tag="tag" />

        <ImageView
            android:id="@+id/esxt"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:onClick="openChecklist"
            android:paddingLeft="30dip"
            android:src="@drawable/desxt"
            android:tag="tag" />

        <ImageView
            android:id="@+id/etja"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:onClick="openChecklist"
            android:paddingLeft="30dip"
            android:src="@drawable/detja"
            android:tag="tag" />

        <ImageView
            android:id="@+id/eiwk"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:onClick="openChecklist"
            android:paddingLeft="30dip"
            android:src="@drawable/deiwk"
            android:tag="tag" />

        <ImageView
            android:id="@+id/exfs"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:onClick="openChecklist"
            android:paddingLeft="30dip"
            android:src="@drawable/dexfs"
            android:tag="tag" />
    </org.apmem.tools.layouts.FlowLayout>
</ScrollView>`

Result without ScrollView Result with ScrollView

Spookyguy avatar Mar 08 '17 17:03 Spookyguy

I have a similar problem, in my case, the ScrollView does not display all the FlowLayout at the bottom, so my last two items are partially occluded.

adrianokerbermenvia avatar Aug 07 '17 14:08 adrianokerbermenvia

I have resolved it by adding android:layout_marginBottom="40dp" (value may differ for you) It's hacky but it works.

janmokry avatar Apr 17 '18 04:04 janmokry