strings.xml和@string的用法
发布时间:2020-12-15 22:35:39 所属栏目:百科 来源:网络整理
导读:1、layout的代码: TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#FF0000" android:textSize="70px" android:text=" @string/hello " / 2、strings.xml的代码: ?xml version="1.0" encoding="u
1、layout的代码: <TextViewandroid:layout_width="match_parent" android:layout_height="wrap_content" android:background="#FF0000" android:textSize="70px" android:text=" @string/hello" /> 2、strings.xml的代码: <?xml version="1.0" encoding="utf-8"?> 解释:@string/hello指的是在strings.xml文件中定义的hello字符串,即hello字符串中存有“Hello world!”,并在界面中输出。这种用法在将引用程序本地化为另一种语言时用到。 3、stings.xml 用来存储应用程序中所有 字符串常量。这使得您可以很容易地通过替换这些字符串并重新编译应用程序来本地化您的应用程序 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- swift – 如何在Dock中的应用程序中添加菜单?
- 下载Flash Player和Adobe Reader离线安装包
- ruby-on-rails – 你能把变量放在正则表达式中吗?
- quick-cocos2d-x 执行系统命令system( "rd /s /q xxx&#
- test.jpdl.xml文件的分析
- XML 的有力帮手之一——DDT
- ios – 我正在尝试从库jazzy生成文档,但我收到以下错误
- norflash启动和nandflash启动
- ruby-on-rails – Rails – PostGIS postgis_adapter几何问
- 什么是旧的cvSmooth(src,dst,CV_MEDIAN,3)的C替换?