Issue
i am stuck from two days with relative layout..here is my screen snap in linear layout
so its fine. but now i want to add refresh button somewhere on map but i found that it is not possible with linear layout. so i tried in relative layout but cant even get screen as above. my footer layout is always shown at top.. here is my xml code
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<!-- include title bar for all screen -->
<include
android:id="@+id/include1"
layout="@layout/titlebar_layout" />
<com.google.android.maps.MapView
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.63"
android:apiKey="0VkXbAOFvAq7b6uaGHSmnS2a2VosPxoS6ceHY_g"
android:clickable="true" >
</com.google.android.maps.MapView>
<include
android:id="@+id/include2"
android:layout_marginBottom="38dp"
layout="@layout/bottom_layout"/>
</LinearLayout>
any help will be greatly appreciated. thanks in advance
Solution
Try this. Use a frame layout and put the mapview and button inside the frame layout. Thus button will be placed above the mapview. Place it according to your need.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<!-- include title bar for all screen -->
<include
android:id="@+id/include1"
layout="@layout/titlebar_layout" />
<FrameLayout android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_width="1.0" >
<com.google.android.maps.MapView
android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1.63"
android:apiKey="0VkXbAOFvAq7b6uaGHSmnS2a2VosPxoS6ceHY_g"
android:clickable="true" >
</com.google.android.maps.MapView>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right" />
</FrameLayout>
<include
android:id="@+id/include2"
android:layout_marginBottom="38dp"
layout="@layout/bottom_layout"/>
</LinearLayout>
Hope this helps...!!!
Answered By - Renjith
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.