2016-12-03 62 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