- 总结:
tools作用是: 去除警告(Lint提示) + UI预览 , 只是为了方便写布局;
- 详谈:
tools:text //预览文本信息
tools:ignore //忽略某些警告
tools:targetApi //指定所使用的版本
tools:locale //语言指定,去除拼写错误提示(如:在执行拼写检查时,告诉studio本地语言不是英语)
tools:context //告诉ide在预览布局的时候该采用什么样的主题
tools:menu //告诉IDE 在预览窗口中使用哪个菜单
tools:actionBarNavMode //告诉ide app bar(Material中对actionbar的称呼)的显示模式
tools:listitem/listheader/listfooter //在ListView、ExpandableListView、GridView的预览效果中添加子item/头部/尾部的预览布局(注意:android:id="@+id/xxx"必须有才能显示出来),另外在RecyclerView中只有 tools:listitem属性;
tools:showIn //告诉Ide该布局已经被内置到其他布局(通过include或listitem等方式),并展示的是该布局所嵌入的那个布局的全貌;
tools:layout //告诉ide,Fragment在程序预览的时候该显示成什么样(注意:只用于Fragment);
网址推荐: http://blog.csdn.net/Peak1Chen/article/details/51289491
.
网友评论