Issue
I want to create a simple interface with a MapView on top and a Button on bottom to refresh said MapView. Both the elements should fill_parent in width, but I want them to not overlap in height. My problem is that my mapview seems to overlap with my Button and hide it. This is my layout.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
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="match_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="my_api_key" />
<Button
android:id="@+id/close"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:text="@string/title_close" />
</LinearLayout>
Thanks in advance.
Solution
- Use a RelativeLayout
- Place a button as a first child with
layout_alignParentBottom="true", make itlayout_width="fill_parent"andlayout_height="wrap_content" - Place MapView second with
layout_above="@id/close" - Make it
layout_width="fill_parent"andlayout_height="fill_parent"
Answered By - Olegas
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.