Need Help with the android:weightSum and layout_weight attributes

by Business Talk » Thu, 26 Nov 2009 20:43:10 GMT


Sponsored Links
 I have a simple horizontal linear_layout  with bunch of image views in
it. the trick is that the views have different widths, relative to the
size of their parent (the linear layout). I set the layout's weightSum
to a 100 and the layout_weight to let's say 10 of one view and 15 of
the other, on so on. And it did not work. I also tired using float
values setting the weightSum to 1.0 and the layout_weight of the image
views to 0.2 and 0.3 and so on. But it didn't work either. I did
search this group for any references to the weightSum but found
nothing. Any ideas how to handle it?

--



Need Help with the android:weightSum and layout_weight attributes

by Romain Guy » Fri, 27 Nov 2009 01:41:51 GMT


 Hi,

What doesn't work exactly? What are you trying to do and what is the result?

On Thu, Nov 26, 2009 at 4:42 AM, Business Talk


>


Sponsored Links


Need Help with the android:weightSum and layout_weight attributes

by steelbytes » Fri, 27 Nov 2009 09:16:25 GMT


 I think you have to set the width of each item to 0px. then the
weighting will override this?  seems to work for me.

It's a shame that the docs are so spartan.




> >



Need Help with the android:weightSum and layout_weight attributes

by Romain Guy » Fri, 27 Nov 2009 09:39:06 GMT


 Using 0px is mostly an optimization. It is not required.




I think you have to set the width of each item to 0px. then the
weighting will override this?  seems to work for me.

It's a shame that the docs are so spartan.



doesn't work exactly? W...



linear_layout  with bunch of ...

to provide private suppo...
text -

--



Need Help with the android:weightSum and layout_weight attributes

by Business Talk » Fri, 27 Nov 2009 20:56:13 GMT


 Thanks to all, it worked. You can only guess how much time you saved
me. Good Luck






>



Other Threads

1. DatePicker and TimePicker CAN NOT be skined/themed !!

Hi Guys,

Is it just me or Android theme-ing system does not allow to set a theme for
DatePicker and TimePicker? Searching "themes.xml" and "styles.xml" in
Android source code (v1.5), I couldn't find anything related to these two
components!

Aren't they really skinable?

Cheersss,
Armond


--~--~---------~--~----~------------~-------~--~----~

2. Linking Directly To An App In The Market?

Was this ever resolved.  I am looking to link to the Market from my
webpage - ie: someone visits my webpage, I tell them to download from
the market ... how exactly?  Do I tell them to just do a search when
they get there?

Jason Van Anden
http://www.bubblebeats.com







--~--~---------~--~----~------------~-------~--~----~

3. TabHost and startActivityForResult

4. A problem of using webview

5. I want to create the layout sample like settings in Andriod

6. Threads and Screen Orientation Change

7. ADC2 news ?