Multiple choice technology platforms and products

The android:layout_weight property indicates the proportion of the free space that should go to that widget. If you set it to be 1 for one widget and 2 for the other widget. How do you interpret this representation.

  1. Both Widgets will occupy the same free space.

  2. 2nd Widget will use twice the free space that 1st Widget takes

  3. 1st Widget will use twice the free space that 2nd Widget takes

  4. None of above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

layout_weight allocates REMAINING (free) space proportionally. If widget A has weight 1 and widget B has weight 2, the total weight is 3. Widget A gets 1/3 of free space, widget B gets 2/3 - so B gets twice what A gets. The claimed answer B is correct.