Hi I want to use google map in my application but I also want to create own footer menu for it. So it should be looks like header - google map - footer from top to down. I tried to add relativeLayout and linearLayout for embed to mapview but I didnt achieve.
Can you give me an example or tell some way for it?
Read up on the layout weight - http://developer.android.com/guide/topics/ui/layout-objects.html
If you have three views and set the weights to 0, 1 and 0 - then the middle view will resize, the other two will stay a fixed size so it's a good solution for adding header & footer to a resizing view. Try this template code, and note how the layout weights are set:
<?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">
<!-- Header -->
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
/>
<!-- Map -->
<MapView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
....
/>
<!-- Footer, or another embedded Layout -->
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
/>
</LinearLayout>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With