<!-- register start --> <string name="register_username">用户名</string> <string name="register_password">密码</string> <!-- register end --> <!-- login start --> <string name="login_username">用户名</string> <string name="login_password">密码</string> <!-- login end -->
// Java 代码: Resources res = getResources(); String text = String.format(res.getString(R.string.welcome_messages), username, mailCount); // 注意参数的顺序。
<!-- strings.xml start -->
<string name="book">book</string>
<string name="books">books</string>
<!-- strings.xml end -->
if (bookCount == 0) {
text = getString(R.string.book);
} else {
text = getString(R.string.books);
}
<plurals name="book"> <item name="one">book</item> <item name="others">books</item> </plurals> int bookCount = 4; Resources res = getResources(); String bookCount = res.getQuantityString(R.plurals.book, bookCount); // result: books.
<plurals name="book"> <item name="one">%d book found.</item> <item name="others">%d books found.</item> </plurals> int count = 4; Resources res = getResources(); String bookCount = res.getQuantityString(R.plurals.book, count, count); // result: 4 books found.
<string name="html_text" formatted="false"> <![CDATA[ <font color=\'#28b5f5\'>Hello</font> world. ]]> </string> TextView tv = (TextView) findViewById(R.id.tv_txt); tv.setText(Html.fromHtml(getString(R.string.html_text)));
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有