锐利的图标晶莹剔透的Andr​​oid应用 [英] sharp icons crystal clear android app

查看:173
本文介绍了锐利的图标晶莹剔透的Andr​​oid应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

喜下午好于如何提高的PNG我的图标质量的任何想法?我使用Android开发者页面的工具包,但我不能获取锐利画面我的意思是晶莹剔透的,我需要的差异的方式不仅仅是draging到我的布局加载此图标?谢谢

hi good afternoon any ideas in how can i improve png quality of my icons? i used the kit from android developer page but i cant get sharp images i mean crystal clear, do i need to load this icons in a diff way than just draging into my layout? thanks

我用这个布局:

     <!-- Rightend Arrow -->
<ImageView android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/arrow"
    android:layout_alignParentRight="true"
    android:layout_centerVertical="true"/>
</RelativeLayout>

例如,你可以看到在eclipse尖锐的,在模拟器上的右箭头图标和设备看上去模糊:

for example you can see the right arrow icon in eclipse sharp but in emulator and device looks blurred:

推荐答案

您需要为所有密度提供资源。如果你只是放在 RES一个图标/绘制,该资源将被用于和缩放的密度高于 MDPI 。因此,对于一个华电国际设备,你会看到你绘制的放大后(150%)的版本,以及 xhdpi ,你会看到你的图形的200%放大的版本。

You need to provide resources for all densities. If you just place one icon in res/drawable, that resource will be used and scaled for densities above mdpi. So for an hdpi device, you're going to see an upscaled (150%) version of your drawable, and for xhdpi, you'll see a 200% upscaled version of your graphic.

这是不好的。

您将需要使用3到创建更大您的图形版本:4:6:8的比例,其中MDPI是密度(4)。您可以忽略大多 LDPI ,但只是提供一个备用的 RES /绘制。你对华电国际的图标应该是1.5倍大,你的xhdpi图标应该是2倍大。因此,例如,你想在48x48dp(设备无关的像素),显示应在48x48px创建适用于mdpi(放在 RES /绘-MDPI ),72x72px一个图像华电国际(放在 RES /绘,华电国际),以及96×96的xhdpi(放在`RES /绘制-xhdpi)。 Android将自动选择适合您的密度正确的版本,如果你做了它用,并不会对其进行缩放。

You'll need to create larger versions of your graphic using the 3:4:6:8 ratio, where mdpi is the density (4). You can mostly ignore ldpi, but just provide a fallback in res/drawable. Your icon for hdpi should be 1.5x larger, and your xhdpi icon should be 2x as large. So for instance, an image you want to display at 48x48dp (device-independent pixels) should be created at 48x48px for mdpi (placed in res/drawable-mdpi), 72x72px for hdpi (placed in res/drawable-hdpi), and 96x96 for xhdpi (placed in `res/drawable-xhdpi). Android will automatically pick the correct version for your density if you've made it available, and won't scale it.

请记住,显卡将仍然仅作为您最初设计它们一样锋利。

Keep in mind, the graphics still will be only as sharp as you design them originally.

有关详细信息,请参见这篇文章

See this article for more information.

这篇关于锐利的图标晶莹剔透的Andr​​oid应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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