有没有办法获得这种textview,我已经使用过view了,但是由于我的textview高度随文本量的变化而改变,因此我无法在xml或java中预定义视图的高度,因此该视图无法获取所有textview的高度。
任何解决方案?? 我用这个。但是不行...
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:textSize="25sp"
android:textStyle="bold"
android:layout_gravity="center"/>
<RelativeLayout
android:id="@+id/viewp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@+id/title">
<TextView
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="7dp"
android:padding="5dp"
android:textSize="16sp"
android:text="hjdbcefc jc qec jcjejqf cmdn dchhwe c,we djh \n uydcvubcubcbwhchb"
/>
<View
android:id="@+id/view"
android:layout_width="5dp"
android:layout_height="match_parent" <!--if I use here like 20dp, it shows otherwise not-->
android:layout_alignParentStart="true"
android:background="@android:color/darker_gray" />
</RelativeLayout>