Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.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 TextView没有';我不能展示全部内容_Android_Xml_Textview_Scrollview_Android Linearlayout - Fatal编程技术网

Android TextView没有';我不能展示全部内容

Android TextView没有';我不能展示全部内容,android,xml,textview,scrollview,android-linearlayout,Android,Xml,Textview,Scrollview,Android Linearlayout,我的xml布局: <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://sche

我的xml布局:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.LinearLayoutCompat
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".TestingActivity">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">
        <TextView
            android:id="@+id/pt_results"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/blank"/>
        <Button
            android:id="@+id/get_po_results"
            android:onClick="onGetPOResultsClick"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/blank"/>
        </LinearLayout>
    </ScrollView>
</android.support.v7.widget.LinearLayoutCompat>
但我得到的是: 和(文本视图文本的剪切端)

我的第一个猜测是,这都是因为TextView的容量有限,但我没有找到任何关于它的信息

顺便说一句,我看到了这个问题,但这不是我的情况,因为我将LinearLayout包装到ScrollView中


问题是,我需要显示大量的文本。也许TextView不是我需要的工具?TextView有哪些替代方案?

尝试使用下面的字符串,从您的代码输出来看,您的文本似乎不是在“字符”之后读取的,所以我只是更改了

that's

试试下面的字符串

<string name="r0010">code:0010 \n \n \n \n There will be a lot of text. It must separate lines automatically using spaces between lines.
Showing what ScrollView capable of: \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n That\'s a lot of lines</string>
code:0010\n\n\n\n将有大量文本。它必须使用行之间的空格自动分隔行。
显示ScrollView能够显示的内容:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n行太多了
尝试记录字符串,看看是您的TextView剪切了文本,还是传递给TextView的字符串本身被剪切了,这将解释问题

that's
that\'s
<string name="r0010">code:0010 \n \n \n \n There will be a lot of text. It must separate lines automatically using spaces between lines.
Showing what ScrollView capable of: \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n That\'s a lot of lines</string>