1、传入一个 List<String> 数组,控件会自己主动加入TextView,一行显示不下会自己主动换行。而且把上一行末尾的空白通过拉伸而铺满。
2、配置灵活
<com.dd544.bu.MultipleTextView
xmlns:my="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_rl"
android:layout_width="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_height="wrap_content"
my:textSize="12sp"
my:textWordMargin="10dp"
my:textLineMargin="10dp"
my:textColor="#ff0000"
my:textBackground="@drawable/testd"
my:textPaddingLeft="10dp"
my:textPaddingRight="10dp"
my:textPaddingTop="10dp"
my:textPaddingBottom="10dp"
/>
https://github.com/mentor811/MultipleTextView
【 声明:版权全部。欢迎转载,请勿用于商业用途。
--天盟】
自己定义控件-MultipleTextView(自己主动换行、自己主动补齐宽度的排列多个TextView)
原文:http://www.cnblogs.com/cynchanpin/p/6971703.html