ScrollView inside MapView

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

ScrollView inside MapView

Postby puxdroid » Tue Apr 27, 2010 8:21 pm

Hello!

I'm trying to add a ScrollView (vertical) into a MapView. I have tried this code, but it dosn't work :(

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2.  
  3.  
  4. <?xml version="1.0" encoding="utf-8"?>
  5.  
  6. <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  7.  
  8.                         android:id="@+id/home_container"  
  9.  
  10.                         android:layout_width="fill_parent"
  11.  
  12.                         android:layout_height="fill_parent">
  13.  
  14.  
  15.  
  16.         <com.google.android.maps.MapView
  17.  
  18.                          xmlns:android="http://schemas.android.com/apk/res/android"
  19.  
  20.                          android:id="@+id/mapview"
  21.  
  22.                          android:layout_width="fill_parent"
  23.  
  24.                          android:layout_height="fill_parent"
  25.  
  26.                          android:clickable="true"
  27.  
  28.                          android:apiKey="0jprwv5FbPV-ZQUmN1SZ9uaW3f205PA0Hio4xwQ"/>
  29.  
  30.  
  31.  
  32.         <LinearLayout   xmlns:android="http://schemas.android.com/apk/res/android"
  33.  
  34.                             android:layout_width="fill_parent"
  35.  
  36.                                 android:layout_height="fill_parent"
  37.  
  38.                                         android:orientation="vertical"
  39.  
  40.                                         android:gravity="top"
  41.  
  42.                                         android:paddingLeft="5px"
  43.  
  44.                                         android:paddingTop="5px"
  45.  
  46.                                         android:paddingRight="5px">
  47.  
  48.  
  49.  
  50.                  
  51.  
  52.  
  53.  
  54.                 <ScrollView android:id="@+id/ScrollView01"
  55.  
  56.                                 android:layout_width="wrap_content"
  57.  
  58.                                 android:layout_height="wrap_content">
  59.  
  60.                                 <LinearLayout android:id="@+id/LinearLayout01"
  61.  
  62.                                 android:layout_width="wrap_content"
  63.  
  64.                                 android:layout_height="wrap_content">
  65.  
  66.  
  67.  
  68.                                                                
  69.  
  70.                                 <!-- A lots of buttons -->
  71.  
  72.  
  73.  
  74.  
  75.  
  76.                                
  77.  
  78.                                 </LinearLayout>
  79.  
  80.                                 </ScrollView>
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90. </LinearLayout>
  91.  
  92. </FrameLayout>
  93.  
  94.  
Parsed in 0.004 seconds, using GeSHi 1.0.8.4


Can anybody help me?
puxdroid
Developer
Developer
 
Posts: 49
Joined: Wed Nov 25, 2009 11:57 am

Top

Postby nicholas.hauschild » Wed Apr 28, 2010 3:40 am

Hello puxdroid,

It is my understanding that the FrameLayout will place everything in the upper left corner of its parent view (in this case, it is the top level view, or the screen. Adding the MapView and then the LinearLayout will place the LinearLayout (and its contents) on top of the MapView, which may obscure it. I am not sure if this is desired behavior for you or not.

I do not know what you are seeing, so perhaps you can give me (and the rest of this community!) some more details about what you are seeing and what it is that you want to see.

Hope this is helpful
-Nick
nicholas.hauschild
Master Developer
Master Developer
 
Posts: 310
Joined: Fri Dec 04, 2009 4:50 am

Postby puxdroid » Thu Apr 29, 2010 11:16 am

Ok

I want a scrollview like this picture:

Image

How can I do this?
puxdroid
Developer
Developer
 
Posts: 49
Joined: Wed Nov 25, 2009 11:57 am

Postby kekomal » Thu Apr 29, 2010 12:59 pm

What is exactly what doesn't work?

Have you tried changing the order of the LinearLayout and the ScrollView?

Have you tried replacing the FrameLayout home_container by a RelativeLayout?
kekomal
Junior Developer
Junior Developer
 
Posts: 19
Joined: Wed Mar 17, 2010 10:44 am
Location: Bilbao, Spain

Top

Return to Map Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests