简体   繁体   English

在xml预览中排除布局

[英]Exlude layout in xml preview


I've got a RecyclerView in my layout, nothing strange. 我的布局中有一个RecyclerView,一点也不奇怪。
The problem rises when I'm working on the layout and the recycler view's preview occupies all the screen. 当我在布局上工作并且回收者视图的预览占据了所有屏幕时,问题就出现了。
Is it possible to exclude a layout (in this case the Recycler's one) from the preview ? 是否可以从预览中 排除一种布局 (在这种情况下为回收站的布局 )?

Thx anticipately ! 谢谢!

You can set tools:visibility="gone" . 您可以设置tools:visibility="gone" To use it, you have to add the following URI namespace to your root layout 要使用它,必须将以下URI名称空间添加到根布局中

xmlns:tools="http://schemas.android.com/tools"

Tools only apply in XML preview. 工具仅适用于XML预览。

From the doc 文档

Android has a dedicated XML namespace intended for tools to be able to record information in XML files, and have that information stripped when the application is packaged such that there is no runtime or download size penalty Android具有专用的XML名称空间,该名称空间旨在用于能够将信息记录在XML文件中的工具,并在打包应用程序时剥离该信息,从而不会增加运行时或下载量

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM