Home  >  Article  >  Software Tutorial  >  Instructions on how to set menu layout files in Android Studio

Instructions on how to set menu layout files in Android Studio

WBOY
WBOYforward
2024-04-12 18:34:22685browse

Since the characters you entered appear to contain encoding, direct help may not be available. You can send me a text description of the relevant content so that I can better answer your questions. If you have any difficulties please feel free to let me know.

1. The menu folder is not seen in the Android Studio project.

Android Studio设置menu布局文件的方法说明

2. If I want to add a menu layout file to the Android Studio project, my initial approach is: right-click on the res folder and select the xml file to add.

Android Studio设置menu布局文件的方法说明

3. However, you will find that the newly created layout file seems strange. You cannot add menu and item, as shown in the following figure:

Android Studio设置menu布局文件的方法说明

2. Processing method

1. After going through it, I learned that the menu layout file must be created under the menu folder. The correct method is as follows. First, right-click on the res folder, and then as shown in the figure below:

Android Studio设置menu布局文件的方法说明

2. Then the following page will appear. Select menu in the Resource type drop-down bar.

Android Studio设置menu布局文件的方法说明

3. Finally, click OK, and the menu folder will come out.

4. Right-click on the menu folder and select as shown below:

Android Studio设置menu布局文件的方法说明

5. Enter the file name and click OK.

The above is the detailed content of Instructions on how to set menu layout files in Android Studio. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:zol.com.cn. If there is any infringement, please contact admin@php.cn delete