转载请注明来源!
一般列表里文字太多的一个折叠效果的空间,效果图如下。
当文字超过设定的行数后就折叠,小于设定行数不显示展开按钮。下面上代码。
先看布局文件:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/color_white" >
<TextView
android:id="@+id/desc_tv"
style="@style/font2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical" />
<TextView
android:id="@+id/desc_op_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/desc_tv"
android:gravity="center_vertical"
android:singleLine="true"
android:text="@string/quan_wen"
android:textColor="#5f897b"
android:textSize="16sp"