如何大小定制标记图标Android的谷歌地图V2?
我要设计自定义图标,使用谷歌地图V2的Android应用程序。我知道有一帮的设计资源,其中描述了如何能创建图标的各种设备和密度。下面是一些信息来源:
I want to design custom icons for an Android app using Google Maps v2. I know there are a bunch of design resources which describe how one would create icons for various devices and densities. Here are some information sources:
- Android cheatsheet for graphic designers
- Android Asset Studio
- Android Developers Iconography
Android SDK中包含一个名为地图样本项目
。尽管它的不可以包含在资源文件夹标记图标。
The Android SDK contains a sample project called maps
. Though it does not contain marker icons in the resource folder.
在示例项目: $ ANDROID_HOME /演员/谷歌/ google_play_services /样本/地图/
但你会如何创建标记图标作为谷歌地图相似,看到在下面的截图:
But how would you create marker icons for Google Maps similar to those seen on the following screenshot:
有没有什么风格指南讲述的图标尺寸为密度,如 LDPI
, MDPI
,华电国际
, xhdpi
, xxhdpi
或 tvdpi
?
Is there any style guide telling about icon sizes for densities such as ldpi
, mdpi
, hdpi
, xhdpi
, xxhdpi
or tvdpi
?
所有的资产必须按照通常的比例:0.75倍(LDPI),1个,1.5倍,2倍,3倍(xxhdpi)。他们还建议你不要太在意奇怪的密度的像tvdpi或xxxhdpi,创造只为3个主要的水桶:MDPI,华电国际和xhdpi
All assets must follow the usual scaling: 0.75x (ldpi), 1x, 1.5x, 2x, 3x (xxhdpi). They also suggest you should not care too much about strange densities like tvdpi or xxxhdpi and create only for 3 major buckets: mdpi, hdpi and xhdpi.
假设所有错误的是固定的,可点击区域标记
是一样的可绘制的区域,我建议创建图标足够大,所以他们很容易pressed,例如:48dp。这样的图像将只有填充有不透明像素中心(16x16dp左右)。
Assuming all bugs are fixed and clickable area for Marker
is the same as drawable's area, I suggest creating icons big enough, so they are easily pressed, e.g.: 48dp. Such an image would have only center (16x16dp or so) filled with opaque pixels.
如果你想有相同的效果与信息窗口出现从这些图像的中心,再添标记
与0x0px图标和武力展示的信息谷歌地图应用程序在无形标记
。
If you want to have the same effect as in Google Maps app with info window appearing from the center of such image, add another Marker
with 0x0px icon and force showing info window on that invisible Marker
.