我应该把"assets"文件夹放在 Android Studio 中的什么位置?

I am confused about the assets folder. It doesn't come auto-created in Android Studio, and almost all the forums in which this is discussed talk about Eclipse.

How can the Assets directory be configured in Android Studio?

转载于:https://stackoverflow.com/questions/18302603/where-do-i-place-the-assets-folder-in-android-studio

csdnceshi59
ℙℕℤℝ Check this tut gadgetsaint.com/android/custom-fonts-textview-edittext-android/…
3 年多之前 回复

19个回答

Step 1 : Go to Files. Step 2 : Go to Folders. Step 3 : Create Assets Folder.

In Assets folder just put fonts and use it if needed.

need configure parameter for gradle
i hope is will work

// file: build.gradle  
sourceSets {
    main {
        assets.srcDirs = ['src/main/res/icon/', 'src/main/assets/']
    }
}

Put the assets folder in the main/src/assets path.

enter image description hereHi it very simple, first of all, assets folder will not create automatic with the project. we need to create it.

The location of Assets folder is:- App->src->assets

please have a look of two simple images:enter image description here

Note: for craeting assets folder just click on project right click select NEW then folder then Assets, it will create assets folder.

Click over main → new directory → directory name "assets"

Simple follow this

File > New > folder > assets Folder

Note : App must be selected before creating folder.

If you tried all your bullets in this thread in vain try cleaning your project . In my case it only worked after Projet -> clean

csdnceshi51
旧行李 This is more like a comment than an answer, but it saved me so +1
4 年多之前 回复

Either create a directory under /app/src/main or use studio File-> New -> Folder - > Assets Folder.

In Android Studio, click on the app folder, then the src folder, and then the main folder. Inside the main folder you can add the assets folder.

csdnceshi68
local-host Don't add in the comment, use edit link and update your answer
4 年多之前 回复
csdnceshi76
斗士狗 In Android Studio click on app folder, then src folder, then main folder . Inside main folder you can add Assets folder.
4 年多之前 回复
csdnceshi68
local-host This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
4 年多之前 回复
共19条数据 首页 2
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐