在所有的Andr​​oid应用程序的图像图标考虑? [英] Are all images in Android apps considered Icons?

查看:124
本文介绍了在所有的Andr​​oid应用程序的图像图标考虑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这已经困扰了我一小会儿了。我可能是反应过度,让我知道,如果我。但是,我觉得像添加图像资产,以你的Andr​​oid Studio项目难度比它应该是。并不一定说这是很难做到的,但我觉得它应该是最容易做的事情之一。

This has bothered me for a little while now. I may be over reacting, let me know if I am. But, I feel like adding image assets to your Android Studio project is harder than it should be. Not necessarily saying it's difficult to do, but I feel like it should be one of the easiest things to do.

我是一个有点新的AS,所以我可能是出路线在这里。

I am a bit new to AS, so I could be way out of line here.

我工作的一个项目,我想补充一个测试图像真正快就摆在图像视图。没有这样做但我只是假设我可以点击一个图像文件,我有我的桌面上拖动到我RES /可绘制文件夹中的AS窗口。我很快意识到我不能。然后我意识到我可以拖动图片到AS查看端口,并打开那里。我以为我可以很快将它保存到我绘制的资产,但同样,没有运气。

I'm working on a project, and I want to add a test image real quick to put in an image view. Not having done this yet I just assume I can click an image file I have on my desktop and drag into my res/drawable folder in the AS window. I quickly realized I can't. I then realize I can drag the image into the view port in AS and it opens there. I assume I can quickly save it into my drawable assets, but again, no luck.

于是我尝试接下来的事情就是在绘制文件夹明知会有一个附加选项,点击右键。我看到添加新的文件。尝试,它有我告诉它是什么样的文件,假设然后我就被要求告诉它我的图像的文件路径,然后把它添加到项目中。没了!它创建没有告诉它我想在我的项目是什么形象的方式(我可以告诉)的空图像文件。

So the next thing I try is to right click on the drawable folder knowing there will be an add option. I see add a new file. Try that, and it has me tell it what kind of file it is, assuming I'll then be asked to tell it my image's file path and then have it added to the project. Nope! It creates an empty image file with no way (I can tell) of telling it what image I want in my project.

我一直四处,并认识到还有还有,当我点击右键可绘制目录的新>资产图像选项。我终于放心了。我点击它,它开辟了启动器图标设置。我可以改变形象,从启动器图标,操作栏和标签图标,并通知图标类型。实际上,有一个文件路径选择,所以是它的工作。我可以加我的形象。

I keep poking around and realize that there's also a New>Asset Image option when I right click the drawable directory. I finally feel relieved. I click on it and it opens up the Launcher Icon settings. I can change the type of image from Launcher Icon, Action Bar and Tab Icons, and Notification Icons. There's actually a file path option, so yeah it worked. I was able to add my image.

但我的问题是,为什么在我的项目,我想这些图片我唯一的选择。是不是几乎所有的应用程序主要是由图像?为什么是这个过程中需要添加的每一个形象?再次,为什么图像需要被归类为这三个选项之一。什么游戏呢?我没有做了一个游戏还,但几乎所有的东西在游戏中是一个形象的资产,而不是一个图标。

But my question is, why are those my only options for images I want in my project. Aren't almost all apps primarily made of images? Why is this process necessary to add every single image? And again, why would an image need to be classified as one of those three option. What about games? I haven't made a game yet, but almost everything in a game is an image asset and NOT an icon.

有另一种非图标图像资源添加到项目中完全显而易见的方法是什么?我是彻底结束了反应,只是因为我需要标记所有图像作为某种图标的,即使它并不真的重要吗?让我知道我是在下面多么可笑或右态度。

Is there another completely obvious way to add non icon image assets to your project? Am I completely over reacting, just because I need to label all images as some kind of icon, even though it doesn't really matter? Let me know how ridiculous or right minded I'm being below.

感谢

推荐答案

将图像添加到您的项目是很容易的,我觉得你是在反应:)。
在一个机器人工程的资源目录的结构使得它允许基于大小或它呈现为(图标或原样)什么上不同的图像。对于充当图标的图像,是合适的将它们放置在资源/ MIP-地图文件夹。为以图标应当被放置在资源/可绘夹不会呈现其他图像。无论是内部的MIP-地图或绘制文件夹,你可以有不同大小的图像,从MDPI到xxhdpi的其他文件夹。

Adding images to your project is quite easy and I think you are over reacting :). The resources directory in an android project are structured such that it allows for different images based on either size or what it is rendered as (icon or as is). For images that serve as icons, it is appropriate to place them in the resources/mip-map folder. For other images that won't be rendered as icons should be placed in the resources/drawable folder. Inside either of mip-map or drawable folder, you can have additional folders for different sizes of images ranging from mdpi to xxhdpi.

也就是说,你可以决定简单地使用Ctrl + C和去在AS和Ctrl + V的相应目录将图片添加到您的Andr​​oid项目(见karaokyo对如何使这些目录中为可见的答案)。 AS有时会尝试自动检测图像的大小,并提出相应的文件夹。否则,你就必须这样做你自己。

That said, you could decide to add images to your Android project by simply using Ctrl+C and going to the appropriate directory in AS and Ctrl+V (see karaokyo's answer on how to make these directories visible in AS). AS at times will try to auto detect the image size and suggest the appropriate folder. Otherwise you'll have to do this yourself.

这篇关于在所有的Andr​​oid应用程序的图像图标考虑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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