TextView 文字太长?不妨让它伸缩自如

4,270 阅读1分钟

# TextViewExpandableAnimation

Expandable TextView With Smooth Transition Animation

Preview

preview

How to get it work?

  • Clone or download my project

  • Copy TextViewExpandableAnimation.java and some resource files such as attrs.xml into your own project

  • in xml layout file


in java
java
TextViewExpandableAnimation tvExpand = (TextViewExpandableAnimation) findViewById(R.id.tv_expand);
tvExpand.setText(text);

All Done!


Attributes Support as below

Attrs
tvea_expandLines
tvea_expandBitmap
tvea_shrinkBitmap
tvea_textContentColor
tvea_textContentSize
tvea_textExpand
tvea_textShrink
tvea_textStateColor