本文介绍了res/menu和res/xml不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试按照指南中的说明在 res/menu 中创建新的菜单资源文件时,该文件夹不存在.都不是 res/xml .有人可以告诉我如何解决这个问题吗?我试图创建文件夹,但不允许这样做

When I try to create a new menu resource file in res/menu as stated in the guide, the folder is not there. Neither is res/xml. Can someone tell me how to solve this problem? I tried to create the folder but it didn't allow me to do so

推荐答案

如果它在android studio v2.1.1中,请按照以下步骤创建res/menu文件夹:

If it is in android studio v2.1.1, to create a res/menu folder follow these steps:

右键单击 res -> New -> Android资源目录->在下拉菜单中将资源类型"更改为菜单"下拉菜单->单击确定"

Right click on res -> New -> Android resource directory -> Change the Resource type to 'menu' in the drop-down menu -> click OK

要在菜单文件夹下创建菜单文件,请按照下列步骤操作:

To create menu file under menu folder follow these steps:

右键单击菜单文件夹-> 新建-> 菜单资源文件->输入文件名->单击确定".

Right click on menu folder -> New -> Menu resource file -> Give the file name -> click OK.

注意:对于xml文件,该过程相同,但是在下拉菜单中选择"xml"而不是"menu"

Note: For xml file it's the same procedure but in the dropdown menu choose 'xml' instead of 'menu'

这篇关于res/menu和res/xml不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 22:19