I have downloaded the new android studio that has been released recently. I am unable to find the UI design preview for the xml, as it is in eclipse. Any help or suggestions on that?
我已经下载了最近发布的新的android工作室。我无法找到xml的UI设计预览,就像在eclipse中一样。对此有何帮助或建议?
1 个解决方案
#1
35
Open a xml layout file:
打开xml布局文件:
- at the bottom, you have two tabs: Design/Text
- 在底部,您有两个选项卡:设计/文本
- in design mode, you see the preview directly
- 在设计模式下,您可以直接看到预览
- in text mode, the preview is (by default) on the right, toggled by a 'Preview' button in the rightmost bar
- 在文本模式下,预览是(默认情况下)在右侧,通过最右侧栏中的“预览”按钮切换
You can also show/hide it with View > Tool Windows > Preview
您还可以使用“视图”>“工具窗口”>“预览”来显示/隐藏它
EDIT
编辑
Attention: the IDE only displays the preview if editing a layout file in the res/layout* directory of an Android project. In particular, it won't be displayed if editing a file in build/res/layout* since those are not source directory but output directory.
注意:如果在Android项目的res / layout *目录中编辑布局文件,则IDE仅显示预览。特别是,如果在build / res / layout *中编辑文件,则不会显示它,因为它们不是源目录而是输出目录。
The Resource folder is set automatically, and can be viewed (and changed) in Project Structure > Modules > [Module name] > Android > Resources directory.
资源文件夹自动设置,可以在项目结构>模块> [模块名称]> Android>资源目录中查看(和更改)。
#1
35
Open a xml layout file:
打开xml布局文件:
- at the bottom, you have two tabs: Design/Text
- 在底部,您有两个选项卡:设计/文本
- in design mode, you see the preview directly
- 在设计模式下,您可以直接看到预览
- in text mode, the preview is (by default) on the right, toggled by a 'Preview' button in the rightmost bar
- 在文本模式下,预览是(默认情况下)在右侧,通过最右侧栏中的“预览”按钮切换
You can also show/hide it with View > Tool Windows > Preview
您还可以使用“视图”>“工具窗口”>“预览”来显示/隐藏它
EDIT
编辑
Attention: the IDE only displays the preview if editing a layout file in the res/layout* directory of an Android project. In particular, it won't be displayed if editing a file in build/res/layout* since those are not source directory but output directory.
注意:如果在Android项目的res / layout *目录中编辑布局文件,则IDE仅显示预览。特别是,如果在build / res / layout *中编辑文件,则不会显示它,因为它们不是源目录而是输出目录。
The Resource folder is set automatically, and can be viewed (and changed) in Project Structure > Modules > [Module name] > Android > Resources directory.
资源文件夹自动设置,可以在项目结构>模块> [模块名称]> Android>资源目录中查看(和更改)。