开发者

How to Set Layout with Mapview

I have created the Application in which i m Using MapView. Now i want to Use the Back Button in My that MapView. I have develop the Layout but it cant seen the开发者_StackOverflow社区 Button over mapview. When i push back button from Emulator then the Mapview become close and the Back button is shown. Can anybudy help me How to Show Back Button on the MapView. ? Thanks.


Bo basically it may be possible with the overlays but I have done it using RelativeLayout stuff

<RelativeLayout
    android:id="@+id/headerlayout" 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    >

    <Button android:id="@+id/amap_back_btn" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true" android:text="Back">
    </Button>

</RelativeLayout>

<MapViewActivity
    xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mapview"
    android:layout_width="wrap_content" android:layout_height="wrap_content"
    android:clickable="true" android:apiKey="your map key"
    android:layout_below="@+id/headerlayout"
    android:layout_above="@+id/bottomlayout" 
    />

This is all If you find it correct dont forget to mark my answer as check. Best Regards,Anup


You will need to use an overlay to add the back button on the MapView. Have a look at this tutorial which explains on how to add overlays. http://www.anddev.org/viewtopic.php?t=92

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜