tools:context=".MainActivity的作用 (转载)
转自:http://blog.csdn.net/caiwenfeng_for_23/article/details/8373569
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world"
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的作用 (转载)的更多相关文章
- Android tools:context=".MainActivity"的作用
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content& ...
- tools:context=".MainActivity的作用
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content& ...
- tools:context=".MainActivity的作用(转)
android:layout_width="match_parent" android:layout_height="match_parent" android ...
- Android 之 tools:context和tools:ignore两个属性的作用
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools= ...
- 【转】Android tools:context
tools:context="com.example.guolin.scrollertest.MainActivity" 有时候可以看到有这个东西,但是从来没有用过,不知道有什么作 ...
- xmlns:tools="http://schemas.android.com/tools"以及tools:context=".ConfActivity"是什么意思
xmlns:tools="http://schemas.android.com/tools"这个是xml的命名空间,有了他,你就可以alt+/作为提示,提示你输入什么,不该输入什么 ...
- Spring 注解<context:annotation-config> 和 <context:component-scan>的作用与区别
<context:annotation-config> 是用于激活那些已经在spring容器里注册过的bean(无论是通过xml的方式还是通过packagesanning的方式)上面的注解 ...
- spring <context:annotation-config/> 注解作用
<context:component-scan>包含<context:annotation-config/>的作用 <context:annotation-config/ ...
- Spring中<context:annotation-config/>的作用
spring中<context:annotation-config/>配置的作用,现记录如下: <context:annotation-config/>的作用是向Spring容 ...
随机推荐
- php除法的知识点
php除法的知识点 $a = 7; $b = 3; $c = $a/$b; var_dump($c);//float(2.3333333333333) //整数部分+小数点+小数部分=15位 $b = ...
- 用Google Analytics UTM标注社会化媒体分享流量来源
随着社会化媒体营销概念近两年的日益盛行,敢于吃螃蟹的营销工作者们展开了一些尝试,发现对社会化营销效果进行综合评估是一大难点,价值难以衡量.主要原因在于它的营销效果中混杂了直接的目标转化.品牌宣传.品牌 ...
- Linux下建立虚拟内存
查看目前虚拟内存状况 free -m -m表示以MB的单位显示 建立虚拟内存文件 先用df -h确认要放虚拟内存文件的位置,假设为 /data/swap/swap1 创建2G的虚拟内存并启用: dd ...
- 扫描控件Web在线Applet
基于JAVAEE的B/S架构由于java语言的跨平台性 所以操控Window客户端资源能力有限, 目前比较流行是用其他语言如Delphi,VB,C++开发客户端控件 然后再html中用js调用. ...
- ios UITableView 获取点击cell对象
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITabl ...
- 【转载】同步和互斥的POSIX支持(互斥锁,条件变量,自旋锁)
上篇文章也蛮好,线程同步之条件变量与互斥锁的结合: http://www.cnblogs.com/charlesblc/p/6143397.html 现在有这篇文章: http://blog.cs ...
- SGU - 311 Ice-cream Tycoon(线段树)
Description You've recently started an ice-cream business in a local school. During a day you have m ...
- soapUI系列之—-07 调用JIRA Rest API接口【例】
一.调用JIRA接口------实现过滤器搜索问题 1. 在SoapUI中新建 REST Project, 在URI 中输入登录接口的 url (任意一个 Rest 接口的 url 都可以): 2. ...
- HDFS的体系架构
通过对Hadoop分布式计算平台最核心的分布式文件系统HDFS.MapReduce处理过程,以及数据仓库工具Hive和分布式数据库Hbase的介绍.基本涵盖了Hadoop分布式平台的全部技术核心. H ...
- 2.NetDh框架之简单高效的日志操作类(附源码和示例代码)
前言 NetDh框架适用于C/S.B/S的服务端框架,可用于项目开发和学习.目前包含以下四个模块 1.数据库操作层封装Dapper,支持多种数据库类型.多库实例,简单强大: 此部分具体说明可参考博客: ...