为了账号安全,请及时绑定邮箱和手机立即绑定

Android布局文件中的“ tools:context”是什么?

Android布局文件中的“ tools:context”是什么?

心有法竹 2019-11-04 15:19:13
从最新的ADT新版本开始,我注意到布局XML文件上的这个新属性,例如:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:orientation="vertical"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    tools:context=".MainActivity" />“ tools:context”是做什么用的?它甚至怎么知道写在这里的活动的确切路径?它会查看清单中的应用程序包吗?是否仅限于扩展Context的类或仅扩展活动?它可用于ListView项目等吗?
查看完整描述

3 回答

  • 3 回答
  • 0 关注
  • 2002 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信