Android Studio添加图像 [英] Android Studio Adding Images

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

问题描述

我是android studio的新手.谁能告诉我添加图像的最佳方法是什么?我们有mdpi,xdpi等不同的文件夹..谁能告诉我添加图像和尺寸的最佳方法是什么?

I am new to android studio. Can any one tell me what is the best way to add images as in eclipse? We have different folder like mdpi, xdpi .. Can any one tell me what is the best way to add images and size also?

 I am trying with new->image asset but is this right way? what should be image size 

..与eclipse中一样,我们直接将其添加到res-> mdpi,xdpi

.. as in eclipse we are adding directly to res->mdpi,xdpi

我应该选择多大的尺寸?该工具中的资产类型是什么,它仅提供3个选项,即图标,操作和选项卡,通知要使用哪一个?

What size should i take? What is asset type in that tool it giving only 3 option ie icon, action and tab, notification which one to be take?

推荐答案

只需复制图像:

并将其粘贴到drawable中:

and paste it into drawable:

您也可以拖放.

现在,对于不同的大小,只需使用适当的名称创建一个文件夹. 首先进入项目视图:

Now, for different sizes, just make a folder with the appropriate names. Go into project view first:

然后,在res中看到这些小文件夹吗?

Then, see these little folders in the res?

将每个图像放入每个文件夹.这是不同大小的目录:

Place each image into each folder. Here are the different size directories:

drawable-mdpi for medium-density

drawable-hdpi for high-density

drawable-xhdpi for extra-high-density

drawable-xxhdpi for extra-extra-high-density

就这样.

如果这样做有帮助,请确保通过选中对勾来接受它.如果您还有其他问题,请随时提出,我们很乐意为您提供帮助!

If this helped, make sure to accept it by pushing the checkmark. If you have more questions, feel free to ask, I am happy to help!

编辑问题:

320dp: a typical phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc).  
480dp: a tweener tablet like the Streak (480x800 mdpi).  
600dp: a 7" tablet (600x1024 mdpi).  
720dp: a 10" tablet (720x1280 mdpi, 800x1280 mdpi, etc).

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

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