java android studio 项目中没有菜单文件夹

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37105316/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 02:12:49  来源:igfitidea点击:

There isnt menu folder in android studio project

javaandroidandroid-layoutandroid-studiomenu

提问by riccardo airone

I am newbie with android and android studio.

我是 android 和 android studio 的新手。

I am following a book to learn android, I want to create a menu for my activity but in the project structure window, I am unable to find the menu folder and the sample menu files.

我正在关注一本书来学习 android,我想为我的活动创建一个菜单,但在项目结构窗口中,我找不到菜单文件夹和示例菜单文件。

I attached a screenshot of my Project Explorer:

我附上了我的项目资源管理器的屏幕截图:

enter image description here

在此处输入图片说明

回答by Marcin Orlowski

Not all folders are created automatically with new projects. If you need it, just press right mouse button while pointers is over res/folder in your project and select New...-> Directoryand name it menuand then you put your menu XMLs inside that folder.

并非所有文件夹都是使用新项目自动创建的。如果您需要它,只需在指针res/位于项目中的文件夹上时按下鼠标右键,然后选择New...->Directory并命名menu,然后将菜单 XML 放入该文件夹中。

回答by RRyan

Following are steps to create Menu folder in res:

以下是在 res 中创建 Menu 文件夹的步骤:

  1. Right click on res
  2. New --> Android Resource Directory
  3. Name your directory and set Resource type as Menu.
  1. 右键点击res
  2. 新建 --> Android 资源目录
  3. 命名您的目录并将资源类型设置为菜单。

Your Menu is created.

您的菜单已创建。

回答by user6190218

Right-click on res folder → New → Android Resource Directory:

右键res文件夹→新建→Android资源目录:

Select "Menu" from resource type:

从资源类型中选择“菜单”:

Click OK:

单击确定: