开发者

MapView with button on bottom

开发者 https://www.devze.com 2023-02-25 04:52 出处:网络
I\'m trying to place a button at the bottom of my layout. Here\'s what I did <?xml version=\"1.0\" encoding=\"utf-8\"?>

I'm trying to place a button at the bottom of my layout. Here's what I did

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


    <com.google.android.maps.MapView
        android:i开发者_如何学Pythond="@+id/map" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:apiKey="mykey"
        android:clickable="true" />

    <Button android:id="@+id/button" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:layout_alignParentBottom="true" />


</RelativeLayout>

This works well enough, but the button is overlayed on top of the mapview. I want the mapview to end right on top of the button. I thought I could just set the mapview to layout_height="wrap_content" but that didn't work.

Any suggestions?


Apparently I just needed to add this to my MapView:

android:layout_above="@+id/button"
    android:layout_alignParentTop="true"


jst add the code : android:layout_alignParentTop="true"

0

精彩评论

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