Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 文本视图在放入ListView时垂直截断。无法展开以填充多行_Android_Listview_Textview - Fatal编程技术网

Android 文本视图在放入ListView时垂直截断。无法展开以填充多行

Android 文本视图在放入ListView时垂直截断。无法展开以填充多行,android,listview,textview,Android,Listview,Textview,我已经找了很长一段时间试图找到这个问题的解决办法,但一直没有运气。描述这一点的最佳方式是使用视觉: 当用户输入的内容超过一行时,可以通过什么方式扩展textView 抱歉,这是listitem的my xml的外观: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="matc

我已经找了很长一段时间试图找到这个问题的解决办法,但一直没有运气。描述这一点的最佳方式是使用视觉:

当用户输入的内容超过一行时,可以通过什么方式扩展textView

抱歉,这是listitem的my xml的外观:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >


<TextView
    android:id="@+id/tvItem"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBaseline="@+id/bDelete"
    android:layout_alignBottom="@+id/bDelete"
    android:layout_toLeftOf="@+id/bDelete"
    android:layout_alignParentLeft="true"
    android:layout_marginLeft="10dp"
    android:text="Medium Text"
    android:textAppearance="?android:attr/textAppearanceMedium" />

<Button
    android:id="@+id/bDelete"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:textSize="15dp"
    android:layout_alignParentTop="true"
    android:layout_marginRight="5dp"
    android:text="DONE" />

</RelativeLayout>

这是主屏幕(图中的一个)的xml外观:


在文本视图中的xml中使用此属性,这将为您提供可扩展的文本视图,允许文本视图在用户放入内容时向下移动

android:singleLine="false"

在属性中列表项的布局中

 android:layout_height="wrap_content"

您的列表项布局是什么样子的?不幸的是,textView仍然处于关闭状态。我还遵循了另一个用户关于wrap_内容的建议……这也不会改变输出。问题是我让它与右边的按钮对齐。但是我现在得到了,所以谢谢你!
 android:layout_height="wrap_content"