android官方技术文档翻译——工具属性
本文译自androd官方技术文档《Tools Attributes》:http://tools.android.com/tech-docs/tools-attributes
本文地址:http://blog.csdn.net/maosidiaoxian/article/details/41510581。转载请注明出处。翻译如有错讹,敬请指正。
工具属性
http://schemas.android.com/tools,并且它通常被绑定到 tools: 前缀中:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > ....tools:ignore
<string name="show_all_apps" tools:ignore="MissingTranslation">All</string>使用:
Lint
tools:targetApi
此属性像
Java 类中的 @TargetApi 批注解一样: 它允许您指定一个 API 级别,可以是整数或代码名称,表示此元素需要在此级别之上运行。
<GridLayout tools:targetApi="ICE_CREAM_SANDWICH" >
使用: Lint
tools:locale
此属性可以设置在资源文件的根元素上,并且应该对应于一种语言或一个地区。这会让工具知道文件的字符串被假定为哪种语言(区域)中的。例如, values/strings.xml 可以有此根元素:
<resources xmlns:tools="http://schemas.android.com/tools" tools:locale="es">使用:
Lint, Studio (以在非英语资源文件中禁用拼写检查)
tools:context
<android.support.v7.widget.GridLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity" ... >使用:Studio
和 Eclipse的布局编辑器,Lint
tools:layout
<fragment android:name="com.example.master.ItemListFragment" tools:layout="@android:layout/list_content" />使用:
Studio 和 Eclipse的布局编辑器
tools:listitem / listheader / listfooter
<ListView android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="match_parent" tools:listitem="@android:layout/simple_list_item_2" />使用:
Studio 和 Eclipse的布局编辑器
tools:showIn
<TextView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:text="@string/hello_world" android:layout_width="wrap_content" android:layout_height="wrap_content" tools:showIn="@layout/activity_main" />tools:menu
id 列表 (没有 @id/ 或任何这类前缀)。您还可以使用没有.xml 扩展名的菜单xml文件的名称。需要 Studio 0.8.0 或更高版本。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" tools:menu="menu1,menu2" />tools:actionBarNavMode
Studio 0.8.0 或更高版本。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" tools:actionBarNavMode="tabs" />其他属性: 设计时属性
在布局中,任何其他属性可以是一个内置的
Android 属性别名。例如,这可以让您设置仅设计时的替换文字,用于工具中而不是运行时。详细信息,请参阅设计时布局属性。
android官方技术文档翻译——工具属性的更多相关文章
- Android官方技术文档翻译——Gradle 插件用户指南(5)
昨晚把第五章未译完的几句话攻克了.只是第六章没怎么译,明后天又是周末,假设周一前第六章翻译完的话,周一再发第六章. 本文译自Android官方技术文档<Gradle Plugin User Gu ...
- Android官方技术文档翻译——Gradle 插件用户指南(7)
本文译自Android官方技术文档<Gradle Plugin User Guide>,原文地址:http://tools.android.com/tech-docs/new-build- ...
- Android官方技术文档翻译——Gradle 插件用户指南(6)
没想到翻译这篇<Gradle 插件用户指南>拖了差不多一个月,还跨年了.不过还好,在2号时终于一口气把剩下的给翻译完了(其实那天剩下的也就不到一章). 今天先发一下第六章,明天再发第七章. ...
- Android官方技术文档翻译——Gradle 插件用户指南(4)
最近赶项目,白天基本没时间,只有晚上在家的时候才能看一看.昨天晚上只翻译完了第四章,今天就只发第四章吧. 本文译自Android官方技术文档<Gradle Plugin User Guide&g ...
- Android官方技术文档翻译——开发工具的构建概述
本文译自Android官方技术文档<Build Overview>,原文地址:http://tools.android.com/build. 因为<Android Lint Chec ...
- Android官方技术文档翻译——Gradle 插件用户指南(1-3)
不知道是什么网络问题,上午一直发不了博客,其它页面基本正常,就是在写博客这里,每次打开都是响应超时.刚才用了VPN,顺便试了一下,竟然能够编辑.想是CDN之类的问题吧. 这次翻译的是Gradle 插件 ...
- Android官方技术文档翻译——清单合并
本文译自Android官方技术文档<Manifest Merger>,原文地址:http://tools.android.com/tech-docs/new-build-system/us ...
- Android官方技术文档翻译——新构建系统概述
本文译自Android官方技术文档<New Build System>,原文地址:http://tools.android.com/tech-docs/new-build-system. ...
- Android官方技术文档翻译——Ant 任务
本文译自Android官方技术文档<Ant Tasks>,原文地址:http://tools.android.com/tech-docs/ant-tasks. 由于是抽着时间译的.所以这篇 ...
随机推荐
- hive升级遇到的几个小问题
1.hiveserver2正常启动,但是beeline连不上服务. 我的服务是开在本机的,但是用主机名和127好像都不能访问服务了 jdbc:hive2://172.19.1.11:10000> ...
- c++ 深入理解数组
阅读前提:你得知道啥是数组. 本文需要弄清楚的问题如下: 1,数组作为函数参数,传入的是值,还是地址? 2,数组作为函数参数,数组的长度能否确定? 解决如下 1,数组作为函数参数,传入的是地址.因为数 ...
- JavaScript基础知识必知!!!
JavaScript一种直译式脚本语言,是一种动态类型.弱类型.基于原型的语言,内置支持类型. JS作用:表单验证,减轻服务端的压力:添加页面动画效果:动态更改页面内容:Ajax网络请求. 下面简单介 ...
- AutoMagic-开源自动化平台构建思路
最近在github上看到AutoMagic自动化平台开源了,一时手痒,就试着搭了一套环境,现在把思路和大家说一说. AutoMagic从其工作分工分两部分: 1:Web端管理平台 管理平台基于Pyth ...
- ACM 最小公倍数
给定两个正整数,计算这两个数的最小公倍数. Input 输入包含多组测试数据,每组只有一行,包括两个不大于1000的正整数.Output对于每个测试用例,给出这两个数的最小公倍数,每个实例输出一行. ...
- Android文件大头10G
这个玩意直接10G....记录下. C:\Users\xn\AppData\Local\Android\sdk\system-images\android-23
- Dynamics CRM2016 Web API之删除单个查找字段值
之前的博文中有介绍过,Web Api中的一个删除单个属性的Api但没提供查找字段的删除方法,本篇补充上,这里给出的示例代码是C#的(主要看url的拼接),看下url中最后的/$ref,这个标示表明了当 ...
- Android自定义异常类
当一个项目中,异常可能出现地方非常多的时候就需要考虑封装处理异常信息.本篇博客就对自定义异常做一个封装,模拟实际开发中的异常处理. 新建一个基类异常HException: public class H ...
- Android Studio NDK 代码 Source Insight调试 (NDK 目前开发方案 | NDK 编译 | 导入 so 库 | 项目编码转换)
作者 : 韩曙亮 转载请注明出处 : http://blog.csdn.net/shulianghan/article/details/52088039 最近在移植一个 JNI 项目, 比较纠结, A ...
- [图论]最大流问题(Maximum flow)的定义
首先定义网络(network)N =(V,E), V表示顶点(Vertices)集合, E表示边(Edges)集合. s,t是V中的两个顶点,分别表示网络N中的源点(source)和汇点(sink). ...