【发布时间】:2017-12-30 14:01:50
【问题描述】:
这个问题是关于 Android 中的字符串占位符机制。有很多关于“我如何使用占位符”等的帖子,但我的问题完全不同(或者我只是很愚蠢),我在网上找不到答案。
当我通过 xml 文件引用字符串资源时,如何隐藏占位符?
关键是,如果我有像
这样的字符串资源<string name=mystring>There comes the placeholder: %s</string>
我在whatever.xml 文件中使用它并将TextView 的文本设置为android:text="@string/mystring" 然后它实际上显示"There come the placeholder: %s"时间>。但你可以想象我想避免用户看到“%s”;-)
那么我们该怎么做呢?
干杯
【问题讨论】:
标签: android string resources placeholder