我正在寻找一种方法来执行此操作。 我有一个内部的JSON文件可突出,例如mystrings.json,就是这个样子:从JSON文件设置xml布局中的文本
{
"ErrorCodes.1": "Hai superato il tempo limite",
"ErrorCodes.2": "Hai superato il tempo limite"
}
我想以这种方式来使用JSON:
<TextView
android:text="@ErrorCodes.1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
有一种方法去完成? 我正在寻找,但没有结果。 在此先感谢。
不,你不能做这样的解析某些东西。你必须解析JSON并将'json'的值设置为'textview' –