1. <TextView
  2. android:layout_width="wrap_content"
  3. android:layout_height="wrap_content"
  4. android:layout_centerHorizontal="true"
  5. android:layout_centerVertical="true"
  6. android:text="@string/hello_world"
  7. tools:context=".MainActivity" />

一直对于 tools:context=".MainActivity"这句不懂,今天查了下,发现是这样的:

tools:context="activity name"这一句不会被打包进APK。只是ADT的Layout Editor在你当前的Layout文件里面设置对应的渲染上下文,说明你当前的Layout所在的渲染上下文是activity name对应的那个activity,如果这个activity在manifest文件中设置了Theme,那么ADT的Layout Editor会根据这个Theme来渲染你当前的Layout。就是说如果你设置的MainActivity设置了一个Theme.Light(其他的也可以),那么你在可视化布局管理器里面看到的背景阿控件阿什么的就应该是Theme.Light的样子。仅用于给你看所见即所得的效果而已。

tools:context=".MainActivity的作用的更多相关文章

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

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

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

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

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

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

  4. Android 之 tools:context和tools:ignore两个属性的作用

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools= ...

  5. 【转】Android tools:context

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

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

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

  7. Spring 注解<context:annotation-config> 和 <context:component-scan>的作用与区别

    <context:annotation-config> 是用于激活那些已经在spring容器里注册过的bean(无论是通过xml的方式还是通过packagesanning的方式)上面的注解 ...

  8. spring <context:annotation-config/> 注解作用

    <context:component-scan>包含<context:annotation-config/>的作用 <context:annotation-config/ ...

  9. Spring中<context:annotation-config/>的作用

    spring中<context:annotation-config/>配置的作用,现记录如下: <context:annotation-config/>的作用是向Spring容 ...

随机推荐

  1. Linux系统查看系统版本命令

    以下操作在centos系统上实现,有些方式可能只适用centos/redhat版本系统 uname -a |uname -r查看内核版本信息 [root@node1 ~]# uname -a Linu ...

  2. codeforces 228E The Road to Berland is Paved With Good Intentions(2-SAT)

    Berland has n cities, some of them are connected by bidirectional roads. For each road we know wheth ...

  3. a3

    队名 massivehard 组员一(组长:晓辉) 今天完成了哪些任务 .整理昨天的两个功能,补些bug 写了一个初步的loyaut 还剩哪些任务: 后台的用来处理自然语言的服务器还没架. 推荐算法还 ...

  4. 求gcd(最大公因数),lcm(最小公倍数)模板

    gcd(最大公因数),lcm(最小公倍数) #include<iostream> using namespace std; int gcd(int a,int b)//辗转相除法(欧几里德 ...

  5. LintCode-12.带最小值操作的栈

    带最小值操作的栈 实现一个带有取最小值min方法的栈,min方法将返回当前栈中的最小值. 你实现的栈将支持push,pop 和 min 操作,所有操作要求都在O(1)时间内完成. 注意事项 如果堆栈中 ...

  6. TCP系列18—重传—8、FACK及SACK reneging下的重传

    一.介绍 FACK的全称是forward acknowledgement,FACK通过记录SACK块中系列号最大(forward-most)的SACK块来推测丢包信息,在linux中使用fackets ...

  7. Ubuntu下erlang连接SQL SERVER 2008

    erlang连接SQL Server使用ODBC方法,但在网络上还是缺少资料,自己折腾了2天才成功.现在特记录下来,以供大家借鉴. 基本思路是 erlang odbcserver + unixodbc ...

  8. Zigbee安全基础篇Part.1

    原文地址: https://www.4hou.com/wireless/14211.html 导语:ZigBee是一种开源无线技术,用于低功耗嵌入式设备(无线电系统).本文探讨了ZigBee协议的可用 ...

  9. 在linux下如何显示隐藏文件

    #显示所有文件(包含隐藏文件)ls -a #只显示隐藏文件l.或者ls -d .* #在XWindow的KDE桌面中在"查看(View)"菜单里选"显示隐藏文件(Show ...

  10. 【Linux】- Ubuntu 配置mysql远程访问

    ubuntu上安装mysql非常简单只需要几条命令就可以完成. sudo apt-get install mysql-server   安装过程中会提示设置密码什么的,注意设置了不要忘了,安装完成之后 ...