android - Android TextView 中显示的奇怪字符

标签 android textview

我有一个 TextView ,将几个字符显示为矩形,但我不知道它们来自哪里。有什么想法吗?

这是带有文本的 XML:

<item>
Five cents per gallon discount. Go online to www.amerigas.com or yellow pages for the closest AmeriGas location.
\n\n
    
    Offers subject to change without notice, some restrictions may apply, contact store for details. Offer does not apply to fixed price customers. You must provide your Farm Bureau membership number to your AmeriGas dealer prior to delivery of your propane in order to receive the discount.\n
</item>

这是截图:

enter image description here

编辑:在 XML 中,当我将其粘贴到此处时,我注意到 Offers 之前有一个很大的空间,这是字符出现的地方。不过,我的编辑器中没有显示该空间。

最佳答案

我的猜测是,在 XML 文件中的 \n\n 之后,您有制表符或字体无法正确处理的其他一些奇怪的空白字符。将它们替换为常规空格,小方框应该会消失。

关于android - Android TextView 中显示的奇怪字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18447553/

相关文章:

ios - 如何保存文本数据

java - 无法从另一个 Activity 更新 TextView

android - 如何在文本中设置背景图像

android - 错误 : unaligned opcodes detected in executable segment

android - 如何检查 TextView 是否存在

android - Android EditText(TextView)如何绘制闪烁的光标?

android - 选中时 NavigationView 的颜色

java - 如何在 Firebase 中实时存储位置?

java - DatePickerDialog 按钮不显示标签

安卓工作室 : Are language xml files compiled into the apk?