2016-12-03 65 views

回答

1

只需将它添加到你的Android布局为活动/片段

这里举例: https://github.com/osmdroid/osmdroid/blob/master/OpenStreetMapViewer/src/main/res/layout/sample_cachemgr.xml

<?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> 
+0

它不支持它。因此,它不显示 – Temmie

+0

Android支持它,那么为什么将osmdroid重写按钮 – spy

+0

噢谢谢!我猜我只是错了布局笑lol – Temmie

相关问题