如果Android小工具的背景是九补丁?如果有不同的DPI版本? [英] Should android widget backgrounds be nine-patch? Should there be different dpi versions?

查看:203
本文介绍了如果Android小工具的背景是九补丁?如果有不同的DPI版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前android.com的的Widget设计指南页面,谷歌提供小工具在Photoshop格式的背景模板(.PSD)

At android.com's Widget Design Guidelines page, Google provide widget background templates in Photoshop format (.psd)

我知道这些可以编辑和导出为PNG文件,但我有两个问题;

I know these can be edited and exported as png files, but I have two questions;

(一)是否应转换为九宫PNG文件?

(a) should they be converted to nine-patch png files?

(二)我需要创建不同的DPI版本?(LDPI,MDPI,华电国际和放大器; xhdpi)

(b) Do I need to create different dpi versions (ldpi, mdpi, hdpi & xhdpi)?

我觉得答案这两个问题都是是,但奇怪的是,这是没有提及...

I think the answers to both these questions are "Yes" but it is strange that this is not mentioned...

推荐答案

从我个人的经验:是的,这两个结果
优化多个屏幕大小和密度,你会与任何其他的布局做。这包括资源类型是在一定情况较好的选择,9patches或位图的密度不同的版本。

From my personal experience: Yes to both.
Optimize for multiple screen sizes and densities as you would do with any other layout. That includes the choice which resource type is better for a certain situation, 9patches or different density-versions of a bitmap.

关于文档结果
我不是对这个有信心100%,但在我看来,这是为Android 1.5编写。 (因为小部件在1.5中引入)。从那以后,再没有碰过。对于不同的屏幕分辨率和密度来支持大多在1.6。 - 这改变了这个小部件文档中提到的一切。一个很好的指标,这是他们给你楼下精确的像素尺寸的事实。这样做是有意义的1.5,但不是在1.6。或更高版本。因此,他们不覆盖整个密度独立/分辨率的主意。

Concerning the documentation
I'm not 100% confident on this, but it seems to me this was written for Android 1.5. (since widgets were introduced in 1.5.) and never touched again since then. Support for different screen resolutions and densities came mostly in 1.6. - which changes everything mentioned in this widget doc. A good indicator to this is the fact that they give you exact pixel dimensions down below. This does make sense in 1.5., but not in 1.6. or newer. And therefore they don't cover the whole density-independence/resolutions idea.

这篇关于如果Android小工具的背景是九补丁?如果有不同的DPI版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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