小编Sat*_*lva的帖子

表行内的 TextView 内容被截断

首先,我进行了 Google 搜索并查看了StackOverFlow中与文本被截断相关的问题TextView。尽管它们提供了对某些事情的更好理解,但它们并没有帮助解决当前的问题。

这是我的问题。

我用来TableLayout显示带有两个文本字段的记录。每行有两个TextView单元格。对于所有单元格layout_width都设置为。wrap_content但是,即使文本以多行显示,多行文本中的每一行都会在末尾被切断。

例如

   <?xml version="1.0" encoding="utf-8"?>
   </TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content">
   <TableRow>
        <TextView
            android:text="Notes"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/visitation_notes" />
        <TextView
            android:text="Need to visit again. Visit till the doctor understands the importance of the Test. The problem is, it is very difficult to get appointment for the visit. Still, we need to keep trying till the point reaches to him/her."
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/visitation_notes_value"
            android:textAlignment="viewStart"/>
   </TableRow>
   </TableLayout>
Run Code Online (Sandbox Code Playgroud)

产生了视图

备注:需要再次访问。拜访直到医生 …

android textview android-layout android-tablelayout

5
推荐指数
1
解决办法
3153
查看次数