效果图 (带提示图标)
效果图 (不带提示图标)
activity 文件
ExpandTextView textView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView= (ExpandTextView) findViewById(R.id.cusTextView);
textView.updateText(getResources().getString(R.string.test_expandtext));
}
xml文件
android:background="@android:color/white"
android:id="@+id/cusTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingBottom="8dp"
android:paddingTop="8dp"
app:drawableHeight="12dp"
app:drawableWidth="14dp"
app:expandDrawable="@mipmap/up"
app:maxLines="3"
app:shrinkDrawable="@mipmap/down"
app:textColor="@android:color/black"
app:textSize="14sp" />
属性说明