I forgot to set the layout_height of each textview - this works,
thanks as always:
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF880000"
android:weightSum="100">
<TextView android:text="col1"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="50"
/>
<TextView android:text="col2"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="30"
/>
<TextView android:text="col3"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="20"
/>
</LinearLayout>
On Oct 8, 4:34 pm, Mark <[email protected]> wrote:
> Hi guys, I think I'm doing it wrong - is this what it should look
> like?:
>
> <LinearLayout android:orientation="horizontal"
> android:layout_width="fill_parent"
> android:layout_height="50px"
> android:background="#FF880000"
> android:weightSum="100">
>
> <TextView android:text="col1"
> android:layout_width="0px"
> android:layout_weight="50"
> />
> <TextView android:text="col2"
> android:layout_width="0px"
> android:layout_weight="30"
> />
> <TextView android:text="col3"
> android:layout_width="0px"
> android:layout_weight="20"
> />
> </LinearLayout>
>
> Thanks
>
> On Oct 8, 4:31 pm, Romain Guy <[email protected]> wrote:
>
> > It will work only if the sum of the weights is 100.
>
> > On Oct 8, 2009 1:28 PM, "Mark Murphy" <[email protected]> wrote:
>
> > > Is it possible to create a horizontal LinearLayout where we specify > how
>
> > wide percentage-wise ea...
> > I don't know about through Java, but you should be able to achieve a
> > similar effect with android:layout_width (set them all to 0px) and
> > android:layout_weight (use your integer percentages here).
>
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com
> > Android App Developer Books:http://commonsware.com/books.html
>
> > --~--~---------~--~----~------------~-------~--~----~ You received this
> > message because you are s...
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---