You set the scrollview to have a height of wrap_content, which means "be as big as you need to be to show your children." What you want instead is a height of 1.0 and android:layout_weight="1.0"
On Wed, May 6, 2009 at 4:02 PM, Mike <michaeldouglaskra...@gmail.com> wrote: > > OK, I give up. I am trying to create an activity layout that has a > top level vertical linear layout like so: > > <?xml version="1.0" encoding="utf-8"?> > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/ > android" > android:id="@+id/mainLayout" > android:orientation="vertical" > android:layout_width="fill_parent" > android:layout_height="fill_parent" > android:padding="4dp"> > > <TextView android:id="@+id/word" android:layout_width="fill_parent" > android:layout_height="wrap_content" > android:textSize="32dp" > android:textColor="#ffffff" > android:textStyle="bold" > android:text="Word"/> > > <ScrollView android:layout_width="fill_parent" > android:layout_height="wrap_content" > android:padding="4dp"> > > <TextView android:id="@+id/wordDefinition" > android:layout_width="fill_parent" > android:layout_height="wrap_content" > android:textColor="#ffffff" > android:text="A definition."/> > </ScrollView> > > <Button android:id="@+id/backButton" > android:layout_width="fill_parent" > android:layout_height="wrap_content" > android:text="Back" /> > > </LinearLayout> > > This works ok as long as the wordDefinition text isn't very long. > But, when I set the text to something very long, it pushes the back > button off the bottom of the screen. Why??? Isn't the ScrollView > supposed to scroll the text in the child TextView? > > I've tried playing with weights (e.g., giving the top text view a > weight of .2, the scroll view a weight of .7 and the button a weight > of .1, but to no avail. > > What am I doing wrong? > > Regards, > > - Mike > > > > -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---