Saturday 17 July 2021

Arranging ConstraintLayout Flow References From Bottom To Top And Right To Left And Enable Scrolling

I need to fill ConstraintLayout Flow view from Bottom To Top And Right To Left. This is my code:

<androidx.constraintlayout.helper.widget.Flow
    android:id="@+id/flow"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:orientation="vertical"
    app:constraint_referenced_ids="tv1,tv2,tv3,tv4,tv5,tv6,tv7,tv8,tv9,tv10"
    app:flow_horizontalGap="8dp"
    app:flow_verticalGap="8dp"
    app:flow_verticalStyle="packed"
    app:flow_wrapMode="chain"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintHeight_percent=".5"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintTop_toTopOf="parent" />

And this is the result:

enter image description here

(In fact I'm going to set references dynamically Due to the API response, so assume that the views are not in xml layout)

But I need the below one:

enter image description here

And I need the flow references to be scrolled horizontally if it has lots of references. Any help is appreciated.



from Arranging ConstraintLayout Flow References From Bottom To Top And Right To Left And Enable Scrolling

No comments:

Post a Comment