0
我想添加一个按钮重叠,但它不应该基于地理点,而是基于屏幕。所以每当我滚动地图,按钮应该仍然存在,并将保持在那个位置,我该怎么做?如何在地图上添加ButtonOverlay(osmdroid)
我想添加一个按钮重叠,但它不应该基于地理点,而是基于屏幕。所以每当我滚动地图,按钮应该仍然存在,并将保持在那个位置,我该怎么做?如何在地图上添加ButtonOverlay(osmdroid)
只需将它添加到你的Android布局为活动/片段
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/parent_container"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<org.osmdroid.views.MapView
android:id="@+id/mapview"
android:layout_width="match_parent"
android:layout_height="match_parent"
tilesource="Mapnik" />
<Button android:id="@+id/btnCache"
android:layout_width="fill_parent"
android:text="Cache Manager"
android:layout_height="wrap_content"></Button>
</RelativeLayout>
它不支持它。因此,它不显示 – Temmie
Android支持它,那么为什么将osmdroid重写按钮 – spy
噢谢谢!我猜我只是错了布局笑lol – Temmie