gpt4 book ai didi

android - 如何在 map View 中显示 "fixed postion"覆盖?

转载 作者:行者123 更新时间:2023-11-29 18:15:54 24 4
gpt4 key购买 nike

我只是想在 MapView 中显示固定位置的图标。如果它是固定的,Overlay 会起作用,但是当用户移动 map 时它会移动。但我需要修复此图标。

最佳答案

您可以像这样将 MapView 和 ImageView 包含在 RelativeLayout 中

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<MapView
android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="X" />

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:src="@drawable/icon" />
</RelativeLayout>

关于android - 如何在 map View 中显示 "fixed postion"覆盖?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8098874/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com