[android-developers] Re: Child TextView in ScrollView with large amount of text pushes other views off the screen

2009-05-07 Thread Romain Guy

It does matter, 0dip is an optimization. If you use something > 0 then
that space will be taken away from other widgets. In this case there's
no reason not to use 0dip.

On Thu, May 7, 2009 at 7:01 AM, Mike  wrote:
>
> 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  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  wrote:
>>
>> > OK, I give up.  I am trying to create an activity layout that has a
>> > top level vertical linear layout like so:
>>
>> > 
>> > 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">
>>
>> >        > >                              android:layout_height="wrap_content"
>> >                              android:textSize="32dp"
>> >                              android:textColor="#ff"
>> >                              android:textStyle="bold"
>> >                              android:text="Word"/>
>>
>> >        > >                                android:layout_height="wrap_content"
>> >                                android:padding="4dp">
>>
>> >                > >                                        android:layout_width="fill_parent"
>> > android:layout_height="wrap_content"
>> >                            android:textColor="#ff"
>> >                            android:text="A definition."/>
>> >        
>>
>> >        > >                        android:layout_width="fill_parent"
>> >                        android:layout_height="wrap_content"
>> >                        android:text="Back" />
>>
>> > 
>>
>> > 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
> >
>



-- 
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
-~--~~~~--~~--~--~---



[android-developers] Re: Child TextView in ScrollView with large amount of text pushes other views off the screen

2009-05-07 Thread Mike

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  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  wrote:
>
> > OK, I give up.  I am trying to create an activity layout that has a
> > top level vertical linear layout like so:
>
> > 
> > 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">
>
> >         >                              android:layout_height="wrap_content"
> >                              android:textSize="32dp"
> >                              android:textColor="#ff"
> >                              android:textStyle="bold"
> >                              android:text="Word"/>
>
> >         >                                android:layout_height="wrap_content"
> >                                android:padding="4dp">
>
> >                 >                                        android:layout_width="fill_parent"
> > android:layout_height="wrap_content"
> >                            android:textColor="#ff"
> >                            android:text="A definition."/>
> >        
>
> >         >                        android:layout_width="fill_parent"
> >                        android:layout_height="wrap_content"
> >                        android:text="Back" />
>
> > 
>
> > 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
-~--~~~~--~~--~--~---



[android-developers] Re: Child TextView in ScrollView with large amount of text pushes other views off the screen

2009-05-06 Thread Romain Guy

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  wrote:
>
> OK, I give up.  I am trying to create an activity layout that has a
> top level vertical linear layout like so:
>
> 
> 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">
>
>                                      android:layout_height="wrap_content"
>                              android:textSize="32dp"
>                              android:textColor="#ff"
>                              android:textStyle="bold"
>                              android:text="Word"/>
>
>                                        android:layout_height="wrap_content"
>                                android:padding="4dp">
>
>                                                        android:layout_width="fill_parent"
> android:layout_height="wrap_content"
>                            android:textColor="#ff"
>                            android:text="A definition."/>
>        
>
>                                android:layout_width="fill_parent"
>                        android:layout_height="wrap_content"
>                        android:text="Back" />
>
> 
>
> 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
-~--~~~~--~~--~--~---