【发布时间】:2016-12-03 02:04:37
【问题描述】:
我想添加一个按钮叠加层,但它不应该基于地理点,而是基于屏幕。所以每当我滚动地图时,按钮应该仍然存在并且会保持在那个位置,我该怎么做?
【问题讨论】:
我想添加一个按钮叠加层,但它不应该基于地理点,而是基于屏幕。所以每当我滚动地图时,按钮应该仍然存在并且会保持在那个位置,我该怎么做?
【问题讨论】:
只需将其添加到活动/片段的 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>
【讨论】: