android xmlns:tools用法
来源:互联网 发布:谁是最可爱的人 知乎 编辑:程序博客网 时间:2024/05/16 14:48
在官方文档中有说这么一句:
These are attributes which are used when the layout is rendered inthe tool, but have no impact on the runtime. This is useful if you for examplewant to put sample data in your textfields for when you are editing the layout,but you don't want those attributes to affect your running app.
这些属性用于渲染布局,而不会影响到程序运行。也就是说只在预览布局时出现,在程序运行时相当于该属性不存在。
这个说明非常有意思,比如我们在布局文件中想要显示一段文字时,而该文字内容在程序中可能动态变化,特别是有参数的字符串内容%1$s之类的内容,以前必须使用android:text显示,然后调整这段文字的大小颜色参数,然后完成后删除android:text属性。有了tools参数后,可以直接使用tools:text在预览时显示文字即可,省却了上面删除的麻烦。
阅读全文
0 0
- android xmlns:tools用法
- android xmlns:tools用法
- android xmlns:tools用法
- android xmlns:tools用法
- android xmlns:tools用法 汇总
- android xmlns:tools
- android xmlns:tools
- android xmlns:tools
- Android布局文件中的xmlns:tools作用以及用法
- Android xml tools 用法 xmlns:tools="http://schemas.android.com/tools"
- android xmlns:tools和xmlns:androidxmlns
- 13.Android xmlns:tools 技巧
- xmlns:tools
- 关于xmlns:tools和android:onClick使用
- 关于xmlns:tools和android:onClick使用
- 关于xmlns:tools和android:onClick使用
- android中xmlns:tools属性详解
- android中xmlns:tools属性详解
- 图像恢复----Retinex算法详解
- uml图中的关系
- BZOJ 4818: [Sdoi2017]序列计数 (动态规划+矩阵乘法)
- eclipse常用快捷键
- LeetCode 198. House Robber
- android xmlns:tools用法
- IDEA如何将master合并到指定支代码
- cocos2d.3.10导入安卓项目相关问题笔记
- JAVA各种系统架构图及其简介
- 翻转单词顺序列
- Android 获取cache缓存的目录路径
- 剑指offer——20.包含min函数的栈
- 数据结构之二叉树之平衡二叉树
- Linux系统卸载openjdk 安装jdk