Android Studio 添加Assets目录

原文地址:Android Studio 添加Assets目录 


Android Studio 添加Assets目录:

法一:

Since Android Studio uses the new Gradle-based build system, you should be putting assets/ inside of the source sets (e.g., src/main/assets/), if I understand correctly.


法二:

In Android Studio, right-click on the  id="iframe_0.3337842207984636" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://i.stack.imgur.com/zgcSy.png?_=4386043%22%20style=%22border:none;max-width:1113px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.3337842207984636',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="margin: 0px; padding: 0px; border-width: initial; border-style: none; width: 50px; height: 22px;"> folder and navigate to the Assets Folder.

id="iframe_0.675528476841726" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://i.stack.imgur.com/kiILk.png?_=4386043%22%20style=%22border:none;max-width:1113px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.675528476841726',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="margin: 0px; padding: 0px; border-width: initial; border-style: none; width: 534px; height: 632px;">

On the next screen just click Finish.

id="iframe_0.6923095103973123" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://i.stack.imgur.com/q0t34.png?_=4386043%22%20style=%22border:none;max-width:1113px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.6923095103973123',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="margin: 0px; padding: 0px; border-width: initial; border-style: none; width: 1080px; height: 649px;">

It will create the assets folder in the main target source set.

id="iframe_0.4650507503442103" src="data:text/html;charset=utf8,%3Cimg%20id=%22img%22%20src=%22http://i.stack.imgur.com/2o3SW.png?_=4386043%22%20style=%22border:none;max-width:1113px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.4650507503442103',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no" style="margin: 0px; padding: 0px; border-width: initial; border-style: none; width: 213px; height: 144px;">

 

 

 

法三:

 Looking inside the .iml file of your project you will see the following line:
  
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
 
Therefore the "assets" folder is already declared for Gradle but you need to create it under src/main/ (I'm using AS 0.4.2)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值