自己定义控件-MultipleTextView(自己主动换行、自己主动补齐宽度的排列多个TextView)
2017-06-09 13:51
399 查看
一、功能:
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" />
能够设置每一个TextView 的字号、颜色、背景、Padding 和 字块之间的margin 、行间距。
二、效果图:
三、源代码:
https://github.com/mentor811/MultipleTextView【 声明:版权全部。欢迎转载,请勿用于商业用途。
--天盟】
相关文章推荐
- 自定义控件-MultipleTextView(自动换行、自动补齐宽度的排列多个TextView)
- [Android] AutoCompleteTextView:自己主动完毕输入内容的控件(自己主动补全)
- Android TextView自己主动换行文字排版參差不齐的原因
- 自己定义TextView 调用ttf格式字体
- Android开发系列(二十):AutoCompleteTextView(自己主动完毕文本框)的功能和使用方法
- 彻底解决android中Textview控件文本自动换行问题
- Android自定义TextView根据控件高度和宽度,解决字体适配问题
- 【android自己定义控件】自己定义View属性
- 自己定义ViewGroup控件(二)----->流式布局进阶(二)
- 自己定义View实现水平滚动控件
- BillBoardView自己定义控件广告板轮播
- Android自己主动提示文本框(AutoCompleteTextView)
- xml中定义个TextView控件及java代码中调用方法。
- Android自己定义实现循环滚轮控件WheelView
- Android——自定义LinearLayout自动换行,TextView垂直排列
- Android 自己定义TextView 实现文本间距
- 自己定义控件(2.2):SurfaceView和SurfaceHolder
- 自己定义控件-GifView
- 自己实现的一个不会奇奇怪怪换行的TextView.
- Android控件TextView中ellipsize属性(设置当文字长度超过textview宽度时的显示方式)