I have tried a Relative layout containing 3 Linear layouts. I'd like to get a thin top layout, a thin bottom layout and a middle layout that takes the available space in between. Here is the XML of my layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/ android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/ android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:id="@+id/LinearLayout_top" android:layout_marginLeft="20dip" android:layout_marginRight="20dip"> </LinearLayout> <LinearLayout android:layout_height="wrap_content" android:id="@+id/LinearLayout_mid" android:layout_below="@id/ LinearLayout_top" X android:layout_width="fill_parent" android:layout_above="@id/ LinearLayout_bottom"> </LinearLayout> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/ android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:id="@+id/ LinearLayout_bottom" android:orientation="horizontal" android:layout_marginLeft="20dip" android:layout_marginRight="20dip"> </LinearLayout> </RelativeLayout> My problem is that I get an error with the layout_above property as shown below Description Resource Path Location Type ERROR Error: No resource found that matches the given name (at 'layout_above' with value '@id/LinearLayout_bottom'). main.xml openmokast-control-android/res/layout line 28 Android AAPT Problem Any help would be appreciated... On Jul 26, 10:08 am, Mark Murphy <[email protected]> wrote: > niko001 wrote: > > Hi, > > > I am using a ScrollView as a child of an AbsoluteLayout to display a > > list of items inside this AbsoluteLayout. Because the ScrollView is > > embedded in the AbsoluteLayout's design, I want to restrict it's size > > to fit the assigned area. Is there any way to set the height of the > > ScrollView or of the RelativeLayout that is the child of my > > ScrollView? > > > Mylayout.xml (with just the important tags): > > > <AbsoluteLayout android:layout_width="fill_parent" > > android:layout_height="fill_parent" /> > > <...some TextViews...> > > > <ScrollView android:layout_width="wrap_content" > > android:layout_height="wrap_content"> > > <RelativeLayout android:layout_width="wrap_content" > > android:layout_height="wrap_content"> > > <...some TextViews that I want to be able to scroll, all > > with wrap_content...> > > </RelativeLayout> > > </ScrollView> > > > <...again, some TextViews in the mainlayout...> > > </AbsoluteLayout> > > > To make it clearer, I have uploaded two images of what I am trying to > > do: > >http://drop.io/v8qobow/asset/current-jpg > >http://drop.io/v8qobow/asset/goal-jpg > > 1. android:layout_height="wrap_content" is meaningless for scrollable > things like ScrollView and ListView. Try using a concrete height. > > 2. Why are you using AbsoluteLayout in this case? The class is > deprecated, and from those JPEGs, it would not seem as if AbsoluteLayout > is, er, absolutely required. For example, if you used RelativeLayout, > you could specify your ScrollView as coming between some of the other > items (e.g.,aboveandbelowthose TextViews), and therefore you could > get a concrete height that way. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > Looking for Android opportunities?http://wiki.andmob.org/hado --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

