1、传入一个 List<String> 数组,控件会自己主动加入TextView,一行显示不下会自己主动换行。而且把上一行末尾的空白通过拉伸而铺满。

2、配置灵活

<com.dd544.bu.MultipleTextView
        xmlns:my="http://schemas.android.com/apk/res-auto"
        android:
        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"
    	/>

能够设置每一个TextView 的字号、颜色、背景、Padding 和 字块之间的margin 、行间距。


二、效果图:

自己定义控件-MultipleTextView(自己主动换行、自己主动补齐宽度的排列多个TextView)


三、源代码:

https://github.com/mentor811/MultipleTextView


【 声明:版权全部。欢迎转载,请勿用于商业用途。

 --天盟】

相关文章:

  • 2022-12-23
  • 2021-09-11
  • 2021-12-19
  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-10-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-29
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
  • 2021-09-27
相关资源
相似解决方案