1
<string name="text_9">This may not happen. If this happened, reset in 2–4 mins.</string>
我用这样的:我们是否需要在Android中替换strings.xml文件中的逗号?
AlertDialog alertDialog = new AlertDialog.Builder(this).create();
alertDialog.setMessage(getResources().getText(R.string.text_9));
的layout.xml看起来像
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="15dp" >
<TextView
android:id="@+id/explain_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#00000000" />
</LinearLayout>
显示的结果总是 “这可能不会发生。如果发生这种情况。” 逗号后的所有内容都没有显示出来。我试图用'\'和'\ u002c'替换逗号,但都不起作用。如果我删除逗号,则会显示所有内容。
如何替换逗号以取代完整描述?
你的字符串很好。你在TextView中使用它吗?请发布其布局xml。 – brillenheini
所以layout.xml是对话框的自定义布局?你如何使用它? – brillenheini