项目名:ParagraphBgTextView
Android 段落分行背景TextView
How to use 如何使用
使用 JCenter 在项目的 build.gradle 中添加如下代码
compile 'com.vita.widget:ParagraphBgTextView:1.0.0'
编译成功后,在layout xml文件加入,如下:
<cn.vita.widget.paragraphbgtextview.ParagraphBgTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:lineSpacingExtra="4dp"
android:textSize="18sp"
android:text="窗前明月光\n疑似地下霜\n举头望明月\n低头思故乡"
ParagraphBgColorTextView:paragraphBgColor="#FF0000" />
ParagraphBgColorTextView:paragraphBgColor 填写对应的颜色值
效果图
介绍了一个名为ParagraphBgTextView的Android自定义组件,该组件可在TextView中实现每行文本的背景颜色设置,适用于需要丰富视觉效果的应用场景。通过简单的布局配置即可实现。

5493

被折叠的 条评论
为什么被折叠?



