Wouldn't that push anything new you added below the title all the way to the
bottom?

I was thinking about more of the pictures below. Though, of course I was
only assuming what he would add later.

Would I be right on this? If the weight of Title was 1 with no linear layout
it would look like pic 2, where with the linear layout holding the weight 1
it would look like pic 1?

Just want to make sure I understand it.

|=========================|
| |=====================| |
| | [ Title           ] | |
| | [ Some Widget     ] | |
| |                     | |
| |                     | |
| |                     | |
| |                     | |
| |=====================| |
| [ Button ]              |
|=========================|

|=========================|
| [---------------------] |
| [ Title               ] |
| [                     ] |
| [                     ] |
| [                     ] |
| [                     ] |
| [---------------------] |
| [ Some Widget ]         |
| [ Button ]              |
|=========================|


On Thu, Oct 2, 2008 at 9:20 AM, Romain Guy <[EMAIL PROTECTED]> wrote:

>
> Even if you add items between the text and the button, you still don't
> need a second LinearLayout :)
>
> On Thu, Oct 2, 2008 at 9:02 AM, Zachary Becker <[EMAIL PROTECTED]> wrote:
> > I put the LinearLayout there because I assumed he would be adding items
> > between the title and the button.
> >
> > Thanks, for the advice on weight though. Not totally comfortable with
> > relative layouts yet. =\ Getting there. =)
> >
> > On Thu, Oct 2, 2008 at 8:58 AM, Romain Guy <[EMAIL PROTECTED]> wrote:
> >>
> >> There is no need at all for a second linear layout. The weight can be
> set
> >> directly on the text view. Also, your example is wrong because a weight
> is
> >> meaningless when the dimension is fill_parent. Last but not least, using
> >> weight causes linear layout to do two measurement passes. In a case like
> >> this were weight can be avoided, it's better to do so.
> >>
> >> On Oct 2, 2008 8:48 AM, "Zachary Becker" <[EMAIL PROTECTED]> wrote:
> >>
> >> Another option would be to put your title in a LinearLayout with weight
> 1
> >> so that it takes up all the vertical space except for the space the
> button
> >> takes up.
> >>
> >> <?xml version="1.0" encoding="utf-8"?>
> >>
> >> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android
> "
> >>    android:orientation="ve...
> >>
> >>    <LinearLayout android:layout_width="fill_parent"
> >>
> >>       android:layout_height="fill_parent"
> >>
> >>       android:layout_weight="1">
> >>
> >>       <TextView android:layout_width="fill_parent"
> >> android:layout_height="wrap_content"
> >>
> >>          android:text="This is a Title" />
> >>
> >>    </LinearLayout>
> >>
> >>    <Button android:layout_width="wrap_content"
> >> android:layout_height="wrap_content"
> >>
> >>       android:layout_gravity="bottom"
> >>       android:id="@+id/Submit"
> >>       android:text="Button 1" />
> >>
> >> </LinearLayout>
> >>
> >> On Thu, Oct 2, 2008 at 8:36 AM, Cadge <[EMAIL PROTECTED]>
> >> wrote: > > > Ok I understa...
> >
> >
> > >
> >
>
>
>
> --
> Romain Guy
> www.curious-creature.org
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to