Hi All,
LinearLayout obeys weight and as per documentation weight gives
priority to an object. Here is the layout I have:
Here you can see that the first textview has a weight of 2, second has
a weight of 0, but still the second text view takes up all the space.
If I give the first edit view a weight of 0 and second a weight of 2,
surprisingly, first edit view gets more space. Isn't this weird, or am
I doing something very wrong. I am poor in layouts.
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal">
<TextView android:id="@+id/Text1"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content" android:text=" first text
which
is also big"
android:layout_weight="2" android:layout_width="wrap_content" />
<TextView android:id="@+id/Text2"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="0"
android:text=" Veeeeeeery Loooooooong Text that fills up alll
space" />
</LinearLayout>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---