标签:
今天在研究前辈写的代码的时候,突然发现string里面出现了<stringname="item_recent_photo">最近拍摄%1$s</string>
有点蒙圈,这个不是c语音里面的表示方式,就百度了一下,记。。。
在TextView中想要动态的显示某些值,用到%1$s,%1$d,先介绍一下:
String sAgeFormat = getResources().getString(R.string.old);
String sFinalAge = String.format(sAgeFormat, 23);
view sourceprint?1 String sAgeFormatString sAgeFormat1= getResources().getString(R.string.alert);
String sFinal1 = String.format(sAgeFormat1, "李四","首都北京");
android中string.xml中%1$s、%1$d等的用法
标签:
原文地址:http://www.cnblogs.com/mbp-study/p/5915982.html