【发布时间】:2019-02-20 18:17:41
【问题描述】:
我有一个片段,里面包含谷歌地图。我想在谷歌地图上的 imageview 中显示一个标记,以通过拖动它来选择地图上的坐标。
我想要什么
但就是这样,标记在 android 设备上的应用程序上是不可见的。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
>
<ImageView
android:id="@+id/imageView"
android:layout_width="40dp"
android:layout_height="70dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="125dp"
app:srcCompat="@drawable/marker" />
<fragment
android:id="@+id/mappin"
android:layout_width="match_parent"
android:layout_height="250dp"
class="com.google.android.gms.maps.SupportMapFragment"
>
</fragment>
<Button
android:id="@+id/ok"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/mappin"
android:layout_alignParentStart="true"
android:layout_marginStart="0dp"
android:layout_marginTop="2dp"
android:text="Button" />
谢谢。
【问题讨论】:
-
使用框架布局并将Imageview移动到mapview下方(在xml中)
标签: java android xml google-maps android-layout