微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在地图视图上显示小部件

如何解决在地图视图上显示小部件

| 我是android应用程序的新开发人员。我想在我的应用程序中显示Google地图。在这里,我想在地图视图上显示android小部件。我可以显示android小部件吗?例如按钮,编辑文本框,文本视图等。 我有用于获取xml中的地图的设计代码,如下所示
<com.google.android.maps.MapView
             android:id=\"@+id/mapId\" 
             android:layout_width=\"fill_parent\"
             android:layout_height=\"fill_parent\"
             android:enabled=\"true\"
             android:clickable=\"true\"
             android:apiKey=\"XYX_API_CODE_HERE_XYX\"
             />
请任何人可以帮助我 谢谢     

解决方法

android SDK随附有beautifull演示:   如果您想查看示例代码,则Google API插件包含一个名为MapsDemo的示例应用程序,您可以将其加载到开发环境中并运行。该应用程序位于Google APIs目录中:/ add-ons / google_apis-API_LEVEL / samples / MapsDemo 编辑: 我首先错读了你的问题。您想做的最好用ѭ1来完成。 IE:
<FrameLayout 
         android:layout_width=\"fill_parent\"
         android:layout_height=\"fill_parent\">
    <com.google.android.maps.MapView
         android:id=\"@+id/mapId\" 
         android:layout_width=\"fill_parent\"
         android:layout_height=\"fill_parent\"
         android:enabled=\"true\"
         android:clickable=\"true\"
         android:apiKey=\"XYX_API_CODE_HERE_XYX\"
         />
     <LinearLayout 
         android:layout_width=\"fill_parent\"
         android:layout_height=\"fill_parent\" android:orientation=\"vertical\">
           <!-- Your other widgets (buttons,inputBoxes,etc) goes here -->
     </LinearLayout>
</FrameLayout>
    ,使用FrameLayout,可以在同一空间中添加不同的视图。 在布局xml文件中,编写一个FrameLayout及其子元素作为MapView以及按钮,textview等。 您可以使用layout_gravity将视图组织为左,右,中心,center_horizo​​ntal,center_vertical等。     

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。