在 Android Studio 中添加资产文件夹 [英] Adding an assets folder in Android Studio

查看:46
本文介绍了在 Android Studio 中添加资产文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android Studio 再次改变了它的项目结构......现在是

Android Studio has changed its project structure yet again... now it is

project
└── app-module
    ├── manifests
    ├── res
    └── java

我一直在网上到处寻找,但找不到放置资产文件夹的位置.当我尝试通过 Android Studio 中的目录查看器(右键单击,新建 ... 目录)创建文件夹时,目录"将被打开.选项不可用.唯一可用的选项是:

I've been looking everywhere online, but I can't find where to put the assets folder. When I try to create the folder via the directory viewer in Android Studio (right-click, New... directory) the "directory" option is not available. The only available options are:

Java Class
File
Module
Package
Image Asset

这些都不能满足我的要求.

None of which will do what I want here.

有人发现了吗?

推荐答案

您可以单击 Project 窗口,按 Alt-Insert,然后选择 Folder->Assets Folder.Android Studio 会自动将其添加到正确的位置.

You can click on the Project window, press Alt-Insert, and select Folder->Assets Folder. Android Studio will add it automatically to the correct location.

您很可能使用新的(ish)Android 视图"查看您的项目.请注意,这是一个视图,而不是磁盘上的实际文件夹结构(自从 Gradle 作为新的构建工具引入以来,它没有改变).您可以通过单击项目"窗口顶部的Android"一词并选择项目"来切换到旧的项目视图".

You are most likely looking at your Project with the new(ish) "Android View". Note that this is a view and not the actual folder structure on disk (which hasn't changed since the introduction of Gradle as the new build tool). You can switch to the old "Project View" by clicking on the word "Android" at the top of the Project window and selecting "Project".

这篇关于在 Android Studio 中添加资产文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆