一个Android布局可以拖动排序子控件:RearrangeableLayout
jopen
10年前
一个Android布局可以拖动排序子控件。
截图:

使用说明:
当以下布局被添加到activity的之后,所有的子view都是可拖动的。
<com.rajasharan.layout.RearrangeableLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/rearrangeable_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:clipToPadding="false" app:outlineWidth="2dp" app:outlineColor="@color/cyan" app:selectionAlpha="0.5" app:selectionZoom="1.2" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Sample Demo" android:textSize="30sp" android:background="@android:color/darker_gray" android:layout_margin="15dp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Sample Demo with very large text that will overflow in width" android:textSize="30sp" android:background="@android:color/holo_green_light" android:layout_margin="15dp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Medium length text" android:textSize="30sp" android:background="@android:color/holo_blue_light" android:layout_margin="15dp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Sample" android:textSize="15sp" android:background="@android:color/holo_orange_light" android:layout_margin="15dp" /> </com.rajasharan.layout.RearrangeableLayout>