为什么官方 Google IO 应用程序只有支持 hdpi 的可绘制对象,但在我的小型 ldpi 设备上看起来却很好?
我正在查看 Android 版开源 Google IO 应用程序的源代码,我发现它们只有“drawables-hdpi”中的可绘制对象(50 个左右中只有 2 个例外)。
阅读 android 指南和文章,我开始认为我们需要支持不同的屏幕尺寸和分辨率,但是 Google 的 IO 应用程序应该反映良好的 GUI 设计模式,但只有 hdpi 的可绘制对象。
更令我困惑的是,它在我的低 dpi 小屏幕(SE Xperia X10 Mini)上看起来还不错。
有人可以澄清我的困惑吗?
I was looking at the source code of the open source Google IO App for android, and I relazied that they only have drawables in the "drawables-hdpi" (with only 2 exception out of 50 or so).
Reading the android guides and articles, I came to think that we need to support different screen sizes and resolution, but Google's IO app, which is supposed to reflect good GUI design patterns only has drawables for hdpi.
What is even more confusing to me is that it looks fine on my small low-dpi screen (SE Xperia X10 Mini).
Can someone please clarify my confusion.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是一个新的答案,因为它的长度不能作为评论发布......Android 将负责缩放。因此,如果您自己简单地缩放图像,则无需提供不同的屏幕。请参阅 Dianne Hackborn(Android 框架工程师)的评论:
来源:https://groups .google.com/forum/?fromgroups#!topic/android-developers/-CMgbDIo0qA%5B1-25%5D
This is a new answer because it cant be postet as comment due to its length... Android will take care of scaling. So it is not necessary to provide different screens if you just simple scale the images yourself. See this comment from Dianne Hackborn (Android framework engineer):
Source: https://groups.google.com/forum/?fromgroups#!topic/android-developers/-CMgbDIo0qA%5B1-25%5D
Android 自己做了很多工作,以便让内容在几乎所有屏幕上都能正常显示。
摘自:支持多个屏幕
具体来说,由于该应用程序只有 hdpi 图像,因此它将缩小它们的尺寸,以便在 mdpi 和 ldpi 屏幕上看起来很好。
Android does a lot of work on its own in order to get stuff to look well on almost all screens.
Taken from: Supporting multiple screens
Specifically, since that app only has hdpi images, it will downsize them to look well on a mdpi and ldpi screen.
Google IO 应用程序适用于 Google IO 会议与会者。如果您还记得的话,所有与会者都会在会议上收到预装此应用程序的 HTC EVO(代替带有地图和时间表的传统活页夹)。因此,由于 EVO 是支持 hdpi 的设备,我猜他们不需要包含非 hdpi 的图标。
至于为什么它看起来不错,blindstuff 已经涵盖了。它们会针对较小的设备自动缩小图标。
The Google IO App was for the Google IO conference attendees. If you remember, all attendees received a HTC EVO at the conference that was pre-loaded with this app (in lieu of the traditional binder with maps and schedules). So since the EVO is a hdpi capable device, I'm guessing they didn't need to include icons that weren't hdpi.
As for why it looks good, blindstuff has that covered. They auto scale the icons down for smaller devices.