logo       

[android-developers] Using layout includes with layouts that are greedy (wa: msg#04264

AndroidDevelopers

Subject: [android-developers] Using layout includes with layouts that are greedy (want to take the entire screen space)


Hi all,

I would like to use an <include /> in my XML file to add a layout
below a MapView(or any other greedy layout). I have been trying for a
few hours now, and no luck so far. I was hoping someone could give me
a hand. Here is what my XML looks like now:

<LinearLayout android:layout_width="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android";
android:layout_height="fill_parent"
android:orientation="vertical">

<!-- A MapView class that loads a google map -->
<org.vuphone.vandyupon.android.viewevents.EventViewerMap
android:id="@+id/event_map" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:clickable="true"
android:apiKey="my_key" />

<include layout="@layout/event_details" />
</LinearLayout>

Optimally, the include could be any sort of other layout. The goal
here is to have the Google map on the top, and then have the included
layout below it. If I include the content in the layout, such as
replacing the <include /> tag with a <TextView /> then that works
correctly, so I am thinking I am mis-using the include. A trip to
hierarchy viewer shows that the included layout has no height. I have
tried putting the include first, and using a RelativeLayout to
position the map above the included layout, but I could not get that
to work correctly (the included layout took the entire screen space,
even though I explicitly said layout_height='wrap_content'

Thanks for any help!

PS - this is a re-post of
http://stackoverflow.com/questions/1214131/using-android-includes-with-layouts-that-like-to-take-the-entire-screen-space

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
android-developers-unsubscribe@xxxxxxxxxxxxxxxx
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise