Sunday, October 4, 2009

[android-developers] Re: Layout - Weight not working

Hi Mark,

I understand that I am doing something wrong.

All I want is to make the first textview take as much space as needed
without wrapping and the second text view to wrap and display. I am
not able to do this simple thing with Linear Layout.

I tried giving 0px for both adn tried different combination of
wrap_content, but I am not able to achieve what I want.

Regards
Siju Mathew

2009/10/4 Mark Murphy <mmurphy@commonsware.com>:
>
>> Layout is not dependant on the weight, it is a weird combination of
>> the text size and the weight.
>
> You are telling Android that you want to have each TextView take up as
> much space as its text requires (android:layout_width="wrap_content") and
> if that does not exactly fit the width, use the weights to deal with any
> extra space or shortfalls.
>
> If you do not want to use the text length as a determining factor in the
> width, then use android:layout_width="0px" and use the weights to
> determine who gets how much space. You cannot use a weight of 0 in this
> case.
>
>> You will understand if you try this in eclipse and see the layout.
>
> Do not rely on Eclipse's GUI preview. Run your code in the emulator.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com
> Android App Developer Books: http://commonsware.com/books.html
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate