android - 在 map View 上显示小部件

标签 android view map widget

我是 android 应用程序的新开发人员。我想在我的应用程序中显示谷歌地图。在这里我想在 map View 上显示 android 小部件。我可以显示 android 小部件,如按钮、编辑文本框、 TextView 等。 ,

我有如下设计代码,用于在 xml 中获取 map

<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 附带了精美的演示:

If you'd like to look at sample code, the Google APIs add-on includes an example application called MapsDemo that you can load into your development environment and run. The application is located in the Google APIs directory:

/add-ons/google_apis-API_LEVEL/samples/MapsDemo

编辑:

我首先误读了您的问题。你想做的最好用 FrameLayout 来完成。即:

<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>

关于android - 在 map View 上显示小部件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6122380/

相关文章:

android - 如何通过我自己的 Android 应用程序与 Facebook 的 API 交互?

java - 单独的字符串输入android

android - 类似电话的数字软键盘

python - 用于在城市 map 上绘制点的好 python 工具包?

android - 如何在android webview中实现phonegap/cordova?

javascript - UI5路由不会实例化 View

mysql - 如何根据不同服务器中不同数据库中存在的表在服务器中的数据库中创建 View ?

python - OpenERP - 不同 View 页面中字段的 onchange 方法?

Hadoop按时间顺序分区

Haskell 列表理解映射