安卓TextView有字符限制吗?

3

我试图在Android TextView中输入超过2000-3000个字符,但它没有显示任何内容。

有人能指导一下吗? Android TextView是否有字符限制?


没有字符限制。如果没有看到您的布局以及如何将文本加载到TextView中,很难说发生了什么,请添加这些额外的细节。 - satur9nine
2个回答

1
我在G3中进行了一些小测试,发现: 如果活动布局中有一个TextView,它可以显示超过4096个字符,但当它属于listview的项目时,它只会显示不可见。因此,没有硬性限制,只取决于设备能够显示什么。

0

发布你的代码,可能是你的TextView需要扩展并填充屏幕,使用ScrollView来处理这个问题。

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:alpha="0.75"
        android:gravity="center_horizontal"
        android:textAppearance="@android:style/TextAppearance"
        android:textColor="@color/alert_dialog_heading_text_color"
        android:textSize="@dimen/text_size_for_subheading" />
</ScrollView>

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接