<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_login"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.tanrong.note_client.ui.LoginActivity"
tools:ignore="TextFields,HardcodedText,UselessParent">

1.tools:context的作用

Eclipse ADT (或AndroidStudio)会根据xml文件实时的绘制我们的布局文件的样式,但是我们也可以在Acitivity中设置布局文件的样式,因此对于一个xml布局文件,我们要知道哪个Activity会修改这个xml,这样Eclipse ADT(或AndroidStudio)同样会实时绘制Activity对xml布局的修改。

所以tools:context就是指定这个XML布局文件对应的Acitivity

2.tools:igore的作用

Android开发中有一个类似Java中的checkstyle的工具(这个是一个检查代码编程规范、排除潜在问题的一个工具),叫android-Lint,但这东西检查出来的有时候不一定是错误,而可能是我们不符合lint中定义的编码规范(这个规范是可以自己定制的,详见http://blog.csdn.net/thl789/article/details/8036066),所以就需要忽略一些错误的警告等(当我们可以确认时)。

所以tools:igore的作用就是忽略一些指定错误,或者 抑制警告

// 忽略全部:

xmlns:tools="http://schemas.android.com/tools"
tools:ignore=“all”

显示所有警告的方法:Analyze -> Inspect Code; 就可以检查出所有的警告;

警告含义总结:http://blog.csdn.net/caroline_wendy/article/details/42245959

警告的类型可以通过文档进行查找: http://tools.android.com/tips/lint-checks
 

参考链接:http://blog.csdn.net/buliuhu123/article/details/39802833

Android 之 tools:context和tools:ignore两个属性的作用的更多相关文章

  1. catalina.home和catalina.base这两个属性的作用

    catalina.home和catalina.base这两个属性仅在你需要安装多个Tomcat实例而不想安装多个软件备份的时候使用,这样能节省磁盘空间.以Tomcat6.0为例,其Tomcat目录结构 ...

  2. android xml布局文件中tools:layout的作用

    摘要 用最新版本的adt 创建一个基于master/detail flow 模版的app的时候,生成的 activity_item_list.xml 文件中有一个tools:layout属性: fra ...

  3. xmlns:tools="http://schemas.android.com/tools"以及tools:context=".ConfActivity"是什么意思

    xmlns:tools="http://schemas.android.com/tools"这个是xml的命名空间,有了他,你就可以alt+/作为提示,提示你输入什么,不该输入什么 ...

  4. Android tools:context=".MainActivity"的作用

    <TextView android:layout_width="wrap_content" android:layout_height="wrap_content& ...

  5. 【转】Android tools:context

    tools:context="com.example.guolin.scrollertest.MainActivity" 有时候可以看到有这个东西,但是从来没有用过,不知道有什么作 ...

  6. tools:context=".MainActivity的作用(转)

    android:layout_width="match_parent" android:layout_height="match_parent" android ...

  7. tools:context=".MainActivity的作用

    <TextView android:layout_width="wrap_content" android:layout_height="wrap_content& ...

  8. tools:context=".MainActivity的作用 (转载)

    转自:http://blog.csdn.net/caiwenfeng_for_23/article/details/8373569 <TextView android:layout_width= ...

  9. Android sdk platform,sdk tools,sdk Build tools,sdk platform tools 的关系

    1. sdk platform 简单理解为系统版本 最新级别: 28:Android 9 27:Android 8.1 26:Android 8.0 25:Android 7.1 24:Android ...

随机推荐

  1. Ubuntu16.04搭建QingdaoU(docker一键式部署)

    QDUOJ已经开源到2.0版本了,下面的教程不再适用,仅做纪念吧! 这几天装什么Linux.开源OJ上瘾了...竟然没去刷题...嗯,做好记录就写题啦! 先上原始网站的图: 风格不错,很符合我的口味. ...

  2. MySQL5.7使用错误解决:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)【取消或重设root密码】

    解决方法: 最简单方法: ⑴打开mysql中的my.ini(如果没有就将my-default.ini复制一份,并修改为my.ini): ⑵在[mysqld]下面空白行直接添加skip-grant-ta ...

  3. 第17月第28天 python yield

    1. class Fab(object): def __init__(self, max): self.max = max self.n, self.a, self.b = 0, 0, 1 def _ ...

  4. NSIS程序安装包制作

    nsis下载地址:http://www.pc6.com/softview/SoftView_14342.html nsis使用: 启动NSIS程序主界面,选择"可视化脚本编辑器(VNISEd ...

  5. 设置linux新用户默认当前目录及使用的shell

    切换到root用户,直接修改/etc/passwd文件,找到你的用户名你一行,如下图所示修改路径,然后保存即可.

  6. Centos6安装FreeSWITCH 1.5时./configure问题解决记录

    系统:Centos 6.4 64位: FreeSWITCH版本:1.5 具体的安装过程参考FreeSWITCH 官网wiki (也可以参考我的博客<Centos6安装FreeSWITCH> ...

  7. sklearn,交叉验证中的分层抽样

    StratifiedKFold用法类似Kfold,但是他是分层采样,确保训练集,测试集中各类别样本的比例与原始数据集中相同. 例子: import numpy as np from sklearn.m ...

  8. javascript判断是用什么设备打开

    var userAgentInfo = navigator.userAgent //查看浏览器用于 HTTP 请求的用户代理头的值 var agents = ["Android", ...

  9. js对象深拷贝

    数组一维深拷贝:slice.concat.Array.from 对象一维深拷贝:Object.assign 一.利用扩展运算符...对数组中嵌套对象进行深拷贝 var arr=[{a:1,b:2},{ ...

  10. python通过Cookie跳过登录验证码

    1.通过浏览器获取登录cookie,找到重要的两个参数“BAIDUID”和“BDUSS”: 2.编写Selenium自动化测试脚本,跳过登录. from selenium import webdriv ...