本文共 164 字,大约阅读时间需要 1 分钟。
需求:TextView中设置字符串为:“一年级有50人”,人数需要动态变化,不能以拼接字符串的形式实现。
一年级有%1$d人
2、在java代码中设置数值
textView.setText(getString(R.string.person_count,50));
转载地址:http://xnsvi.baihongyu.com/