我是 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/