调整启动器图标大小
我正在尝试制作我的 MediaShortcut 应用(来源) 创建启动器图标,其大小取决于屏幕的密度。 该图像是从 android.provider.MediaStore.Images.Thumbnails< 检索的/a>.getThumbnail(getContentResolver(), "imageid"), android.provider.MediaStore.Images.Thumbnails.MICRO_KIND, null)
所以首先我使用以下方法获取屏幕的密度 http://developer.android.com/reference/android/util/DisplayMetrics.html 然后根据此表调整图像大小 http://developer.android.com/ Guide/practices/ui_guidelines/icon_design.html
这似乎在我的大多数设备上运行良好,但在我的华硕滑块上 (和朋友的变压器)图标明显小于 主屏幕上的其他图标。在其他设备上,我注意到图标太大并且只显示了一部分。
有人知道为什么会这样吗?谢谢!
I am trying to make my MediaShortcut app (source)
create launcher icons whose size depends on the density of the screen.
The image is retreived from android.provider.MediaStore.Images.Thumbnails.getThumbnail(getContentResolver(), "imageid"), android.provider.MediaStore.Images.Thumbnails.MICRO_KIND, null)
So first i get the screen's density using
http://developer.android.com/reference/android/util/DisplayMetrics.html
and then resize the image according to this table http://developer.android.com/guide/practices/ui_guidelines/icon_design.html
This seems to work fine on most of my devices but on my Asus slider
(and a friends transformer) the icon is significantly smaller than the
other icons on the home screen. on other devices i have noticed the icon is too big and only part of it is shown.
Does anybody have any idea why this could be? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
自 api 11 起,启动器图标大小是特定于实现的。
我的主屏幕应用程序尊重这一点...
http://developer. android.com/reference/android/app/ActivityManager.html#getLauncherLargeIconDensity()
和
http://developer.android.com/reference/android/app /ActivityManager.html#getLauncherLargeIconSize()
since api 11 the launcher icon size is implementation specific.
i home homescreen apps honor this...
http://developer.android.com/reference/android/app/ActivityManager.html#getLauncherLargeIconDensity()
and
http://developer.android.com/reference/android/app/ActivityManager.html#getLauncherLargeIconSize()