
从最新的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" />什么是“工具:上下文”用于?
它怎么知道写在那里的活动的确切路径?它是否在清单中查看应用程序的包?
它仅限于扩展Context或仅扩展活动的类吗?它可用于ListVIEw项目等吗?
解决方法:
这是工具UI编辑器用于呈现布局预览的活动.记录here:
总结This attribute declares which activity this layout is associated with by default. This enables features in the editor or layout prevIEw that require kNowledge of the activity, such as what the layout theme should be in the prevIEw and where to insert onClick handlers when you make those from a quickfix
以上是内存溢出为你收集整理的Android布局文件中的“工具:上下文”是什么?全部内容,希望文章能够帮你解决Android布局文件中的“工具:上下文”是什么?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)