Skip to content

Latest commit

 

History

History
45 lines (36 loc) · 1.1 KB

File metadata and controls

45 lines (36 loc) · 1.1 KB

TaggingLayout

It's a FlowLayout with gravity for child views.

Snapshot

  • Gravity is center

Gravity Center

  • Gravity is bottom and right

Gravity Bottom & Right

Usage

<com.ktt.toolkit.widget.TaggingLayout
    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="300dp"
    android:padding="10dp"
    app:childHorizontalSpacing="10dp"
    app:childVerticalSpacing="10dp"
    android:gravity="center"
    android:maxLine="2">

    <!-- your custom child views -->
    <TextView text="a" />
    <TextView text="b" />
    <TextView text="c" />
    <!-- your custom child views -->

</com.ktt.toolkit.widget.TaggingLayout>

Properties

  • android:gravity : specify the gravity of child views
    • value: left, right, top, bottom, center, center_horizontal, center_vertical
  • android:maxLine : specify the max lines of child views
  • childVerticalSpacing
  • childHorizontalSpacing