<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. socket传输protobuf字节流实例教程
  2. socket传输protobuf字节流的实例介绍
  3. socket传输protobuf字节流的实例详解
  4. unsigned int几个字节
  5. int占几个字节(c语言)?
  6. C语言中数组所占字节怎么算
  7. golang channel有什么好处
  8. golang中的int占几个字节
  9. golang rune几个字节

随机推荐

  1. OpenGL.Shader:1-重新认识Android上OpenGL
  2. android实现签名功能
  3. Android Compile Error Do not Accept Li
  4. Android Studio实现人民币与美元的转换
  5. Android(安卓)SDK作用和结构
  6. Android7.0中文文档(API)-- AdapterView.On
  7. Android Button的背景图片拉伸变形解决方
  8. 好久米有碎碎念啦 android how to click
  9. 2020-08-07
  10. 关于Android的Activity的onCreate多次调