Android Studio 中缺少布局 XML 文件夹 [英] Layout XML folder is missing in Android Studio
本文介绍了Android Studio 中缺少布局 XML 文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问题:
布局 XML 文件夹丢失?
如何添加?
layout XML folder is missing?
How to add it?
推荐答案
如果该文件夹不存在或在您创建项目时没有自动添加,您需要通过以下方式将其添加到您的项目中:
If the folder isn't there or wasn't added automatically when you created the project, you need to add it to your project in the following way:
- 右键单击
res
文件夹 - 从打开的菜单中选择新建 -> Android 资源目录
- 从打开的弹出窗口中选择资源类型为
layout
- 点击
ok
现在您已经添加了 layout
文件夹,因此您现在可以通过以下步骤开始将 XML
文件添加到此文件夹中:
Now you have added your layout
folder, so you can now start adding XML
files to this folder by the following steps:
- 右键单击
layout
文件夹 - 从打开的菜单中选择新建 -> 布局资源文件
- 输入您的新文件名
- 点击确定
现在您有了一个新的 XML 文件,您可以在任何活动或片段中使用它.
Now you have a new XML file that you can use in any activity or fragment.
这篇关于Android Studio 中缺少布局 XML 文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文