Map Layout and display

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

Map Layout and display

Postby markl16 » Sat Mar 06, 2010 11:00 am

Hi everyone,

Hope all our well.

Quick question regarding the Mapview and layout in android. I have a main layout which has declared the orientation as vertical.
I then have a few textViews which display simple text, now here is the bit im having a bit of bother with, I would like to display a map below these text views. Is this possible, anything i have tried so far has the map taking up the whole page and covering my text views.

Any advice on how to make the map a certain size and have it show below textviews in the same layout.

Any help appreciated.

Best
Mark
markl16
Freshman
Freshman
 
Posts: 6
Joined: Fri Feb 26, 2010 4:44 pm

Top

Postby markl16 » Mon Mar 08, 2010 11:18 pm

Small Update,

Yea i can create a map of specific size using xml and call it within my code, example xml is:

<LinearLayout
android:id="@+id/layout_map1"
android:layout_width="wrap_content"
android:layout_height="116px"
android:orientation="vertical"
android:layout_below="@+id/UpdateCellButton"
android:layout_alignParentLeft="true"
>

</LinearLayout>

But if i try and remove the xml, then create the map through code, the layout params do not work. The map just takes up the whole screen. Below is an example of my code creating the layout for the map. I specify wrap content and 116 as i did in the xml version, but no joy. I was unsure how to specify the layout below and align parent left in code, maybe some one can help me there too please.

LinearLayout main2 = new LinearLayout(main.getContext());
LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, 116);
main2.setLayoutParams(params);
main2.setOrientation(LinearLayout.VERTICAL);

Anybody know my problem and can tell me how to specify 116px for my layout height through code?

Best
Mark
markl16
Freshman
Freshman
 
Posts: 6
Joined: Fri Feb 26, 2010 4:44 pm

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 8 guests