This words, thanks.  However, it appears to me the value you specify
for the height is an arbitrary one.  For example, it doesn't seem to
matter if specify 1dip or 100dip, it still sizes the same.

I assume what's going on is that the layout_weight="1.0" tells the
layout manager to give as much real estate as possible to the
ScrollView and as little possible to it's sibling Views and you just
need to specify SOMETHING for the height.

Regards,

- Mike

On May 6, 4:35 pm, Romain Guy <romain...@google.com> wrote:
> You set thescrollviewto 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">
>
> >        <TextViewandroid: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"/>
>
> >        <ScrollViewandroid:layout_width="fill_parent"
> >                                android:layout_height="wrap_content"
> >                                android:padding="4dp">
>
> >                <TextViewandroid: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 theScrollView
> > supposed to scroll the text in the childTextView?
>
> > 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to