Android提供两个获取strings.xml文件的方法:

CharSequence getText(int resId):返回本地、样式化的字符。
String getString(int resId) :单纯返回字符串

如:

  strings.xml中定义资源文件:

  <

  getText(R.string.sample_text);

  getString(R.string.sample_text);

 

效果图Android getText(int resId) 与 getString(int resId)的区别

 

样式化的定义:

 

<b></b>加粗字体

<i></i> 斜体字体

<u></u> 给字体加下划线

 

参考:http://blog.sina.com.cn/s/blog_5da93c8f01012zhb.html

相关文章:

  • 2022-12-23
  • 2021-09-28
  • 2022-03-08
  • 2021-07-03
  • 2022-01-27
猜你喜欢
  • 2021-10-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-31
  • 2021-08-15
  • 2021-12-14
相关资源
相似解决方案