如何在MapView上显示TextView,按钮(重叠在它上面)..?

Han*_*nry 0 layout android android-mapview

在我的应用程序中我有mapview,我想在textview和按钮中显示距离,

我做了这个.并尝试了这个.. http://www.anddev.org/post3452.html#p3452

问题是>>>>

我想说明OVER地图视图的TextView和BUTTON ..所以我能以全Screen..with其他项目上看到它的MapView(我们可以通过TextView中查看地图)..

任何需要在xml文件中完成的规范.. ??

请..回复我..谢谢你..提前

Anj*_*nju 8

是的,你可以这样做.

例如:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:layout_height="fill_parent">

    <com.google.android.maps.MapView
        android:id="@+id/mapView" android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:enabled="true"
        android:layout_centerInParent="true" android:clickable="true"
        android:apiKey="your api key" />

    <Button android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:text="Click"
        android:layout_alignParentRight="true"
        android:layout_alignParentBottom="true" android:id="@+id/clickBtn" />

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)