我试图从我的 xml 中将按钮的文本设置为“<<<”,但我收到“错误:(20) 解析 XML 时出错:格式不正确(无效标记)”
<Button
android:id="@+id/test"
android:text="<<<"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
所以我跳到我的 strings.xml 那里输入它,但这显然行不通。
<string name="abc"> <<< </string>
有解决办法吗?
最佳答案
这些是 html 实体,也适用于 android studio:
> can be replaced with >
< can be replaced with <
" can be replaced with ", “ or ”
' can be replaced with ', ‘ or ’
} can be replaced with }
& can be replaced with &
space can be replaced with  
关于java - 无法将按钮文本设置为 "<<<",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50397285/