开发者

how to show TextView,Buttons On MapView (To Overlap On It)..?

In my application i have mapview and I want to show distance in a textview and also a Butto开发者_Python百科n ,

I have done this.and tried this.. http://www.anddev.org/post3452.html#p3452

PROBLEM IS>>>>

I WANT TO SHOW TEXTVIEW AND BUTTON OVER THE MAP VIEW.. so I can See MAPVIEW in Full Screen..with other items over it(as we can see map through textview)..

Any SPECIFICATION NEEDED TO BE DONE IN xml FILE..??

Please..Reply me.. Thank You..in advance


Yes you can do that.

For eg:

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


create a layout with the RelativeLayout and embed the map view in it. Once set, set the relative position of your components as per your need.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜