如何在标记下方添加 ProgressBar 和按钮

How to add a ProgressBar and a button underneath a marker


我想在地图中的每个标记下方添加一个按钮和一个进度条。
让我给你看我的地图:

[

这是我用来生成 5 个不同标记的方法(在我的代码中它们是敌人):

public void spawnEnemies(Location location){
   Random r = new Random();

    for (int i = 0; i < 5; i++) {
        enemies[i] = new Enemy("Name", 0, location);
        markerOptions= new MarkerOptions().position(enemies[i].position).title("Monster" + enemies[i].name).snippet("Level" + enemies[i].livello + "\n" + enemies[i].printHealth());
        circleOptions= new CircleOptions().center(nemici[i].position).radius(nemici[i].radius).fillColor(color).strokeColor(strokeColor).strokeWidth(8);
        enemies[i].marker = map.addMarker(markerOptions);
        enemies[i].circle = map.addCircle(circleOptions);

        quantityOfEnemies++;

    }
}

有什么方法可以在标记下方添加对象吗?
感谢您的时间和考虑。

首先了解 Android 地图的 Google API:

Google Map APIs

Maps With Markers

请注意,您可以使用此参考覆盖地图对象:

Map Objects

请在执行上述操作后阅读此文档:

Ground Overlays on Map

我认为您应该完成完整的教程。

您还需要了解磁贴的概念。

Tile Overlays

Now what Uber does is, it keeps two Layout groups, one to show the map, and the other one (FrameLayout) to toggle between animated ImageView with a static ImageView, while the map is dragged and stopped. But these ImageViews stay in their place. So you have to take Map Objects that overlay on it and move along. In one of the objects you can place progress bar.

快乐编码:-).