谷歌Android地图API V2.0 - 包括XML图形页面 [英] Android Google Maps API V2.0 - Including MapView in XML
本文介绍了谷歌Android地图API V2.0 - 包括XML图形页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图插入一个图形页面到一个片段,但是我无法找到正确的类投在图形页面
对象。
I am trying to insert a MapView into a Fragment however I can't find the correct class to cast the MapView
object to.
我插入图形页面
进入我的片段像这样。
I am inserting the MapView
into my fragment like so.
<com.google.android.gms.MapView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/map_view_track"/>
不过,我不可避免地收到了 ClassCastException异常
。
是否有可能插入图形页面
这种方式?我是pretty肯定是的。
Is it possible to insert a MapView
this way? I'm pretty sure it is.
推荐答案
com.google.android.gms.Maps
不存在为一类,据我所知。尝试 com.google.android.gms.maps.MapView
。
com.google.android.gms.Maps
does not exist as a class, AFAIK. Try com.google.android.gms.maps.MapView
.
这篇关于谷歌Android地图API V2.0 - 包括XML图形页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文