我想在谷歌地图上将我的布局显示为标记,但它不能在地图上膨胀。谁能帮我解决这个问题。我使用北极星图书馆。我的代码写在下面:
final View altMarker = ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE))
.inflate(R.layout.map_view, null);
altMarker.setDrawingCacheEnabled(true);
altMarker.buildDrawingCache();
@SuppressWarnings("deprecation")
Drawable drawable = new BitmapDrawable(altMarker.getDrawingCache());
final ArrayList<Annotation> annotations = new ArrayList<Annotation>();
for (Annotation[] region : sRegions) {
for (Annotation annotation : region) {
if (region == sFrance || region == sIndia) {
annotation.setMarker(drawable);
}
annotations.add(annotation);
}
}