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