Understanding measureWithLargestChild: Why breaks the layout?

I'm playing with the option measureWithLargestChild="true". I don't understand why my layout breaks total, if one of my buttons has a too big text onto it. I think it should keep the basic size of 1/3 but they gets smaller about 1/6. Why is that?

Here can you see some screenshots:

Here is my xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" >
        android:measureWithLargestChild="true" >
            android:text="Button123456" />
            android:text="A" />
            android:text="WW" />


I believe this is a bug in measure algorithm. There is following comment in LinearLayout.measureHorizontal(int, int) method.

// Either expand children with weight to take up available space or
// shrink them if they extend beyond our current bounds

It says, the algorithm will shrink items with weight if there is not enough space for them. As measureWithLargestChild is set to true, all items have the same width as the most left item. Now they all together don't fit into the parent's width anymore. Thus they will be shrank. If there were no bug, all items would have same width afterwards. But due to the bug, algorithm shrinks original (wrap_content) widths instead of widths calculated according to measureWithLargestChild attribute. That's why two items on the right became smaller.

Need Your Help

Backup folder using batch or powershell script

windows powershell batch-file

I am learning C# AND Java and I often create small projects and programs in these languages. Usually my source code is at C:......\Visual Studio 2010\Projects\MyProject or

JQUERY / ASP.NET: Reshowing the jquery dialog after an asp.net occurs?

asp.net jquery events jquery-ui postback

Can anyone tell me the easiest way to display a jQuery dialogafter a postback occurs.

AVAssetWriter fails once App goes in background

iphone ios objective-c avassetwriter

I am working on iOS app in which i am creating video from images. I am using AVAssetWriter to achieve this. Everything works fine. But When app goes in background and switched back, the video writing