我想说明通过的setText()一个大胆的文字设定了一个大胆的文字,但我只是看到了一个文字是不是BOLD :(我该如何解决这个问题呢?如何使用的getString()
这里我代码: String.xml:
<string name="country"><b>AMERICA-default</b></string>
我的Java代码:
Resources resources;
TextView tvCountry;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
Log.d("test","onCreate()-second Activity");
setContentView(R.layout.activity_second);
resources = getResources();
tvCountry = (TextView) findViewById(R.id.tvCountry);
tvCountry.setText(resources.getString(R.string.country));//its not working !Text is not bold!
//CANNOT USE : tvCountry.setText(R.string.country);
}
太棒了!我试了,我的文字是粗体:)非常感谢:D – 2014-11-10 08:51:05
@ CuongTruongHuy,很高兴帮助你... – 2014-11-10 08:53:25