[問題] 不透過xml檔來使用google map v2
現在google map v2 不能像舊版一樣放入mapView
而要在 res-->layout-->main.xml 中
放入
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment" />
而要加入這行
class="com.google.android.gms.maps.SupportMapFragment"
必須在xml檔中,來執行google map v2
我的問題是:
在我的程式中,不透過xml檔
來放入class是"com.google.android.gms.maps.SupportMapFragment"的view
請問有什麼辦法嗎?
(像是addView(),addContentView()?
但目前找不到什麼方法放入這個google map的class)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.205.97.16
推
02/17 02:50, , 1F
02/17 02:50, 1F
→
02/17 02:51, , 2F
02/17 02:51, 2F
→
02/18 19:03, , 3F
02/18 19:03, 3F
→
02/18 19:03, , 4F
02/18 19:03, 4F
推
02/23 08:52, , 5F
02/23 08:52, 5F
推n大 最後是用n大的方法完成
只是Activity後面 需要extend FragmentActivity
※ 編輯: AZHI 來自: 123.205.97.187 (03/19 20:25)