<TextView

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="@string/hello"

/>

<TextView

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="hello"

/>

在strings.xml配置string的好处:

1.以后修改方便,类似于C/C++中的宏定义

2.为了国际化

3.节省内存,例如:"hello"被用了10000次,就占用了50000个字节,而使用"@string/hello"则会占用5个,其它地方用到时,就直接取得引用。

更多相关文章

  1. Android各种Layout用到的一些重要的属性
  2. Android(安卓)开发必备
  3. CheckedTextView
  4. android EditText内嵌图片
  5. 咋嘞?你的IDEA过期了吧!加个Jar包就破解了,为什么?
  6. Spring Boot + EasyExcel 导入导出,好用到爆!
  7. 简单入门PHP中的多字节字符串操作
  8. 字节、拼多多前端面经!
  9. Java Agent 动态修改字节码详情

随机推荐

  1. 动画:如何给面试官回答 TCP 的拥塞控制?
  2. python数据分析之清洗数据:缺失值处理
  3. 数据工程师需要掌握的18个python库
  4. 图解 :一篇彻底带你搞懂 JS 中的 this 指
  5. python数据分析——详解python读取数据相
  6. Python一行命令生成数据分析报告
  7. 数据工程师面试必备——Python与数据库的
  8. 用python制作动态图表看全球疫情变化趋势
  9. 2020最值得学习的12款python-web开发框架
  10. 疫情数据哪里找,看这篇就够了