Export to GitHub

droiddraw - issue #191

Layout weight in LinearLayout does not work


Posted on Dec 28, 2010 by Massive Monkey

What steps will reproduce the problem?

Try to create 2 EditTexts in a horizontal LinearLayout so that each occupies 50% of the screen width as in the code:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android&quot; android:id="@+id/LinearLayout" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <EditText android:id="@+id/item1"
android:layout_height="wrap_content" android:layout_width="fill_parent"
android:layout_weight="0.5" /> <EditText android:id="@+id/item2"
android:layout_height="wrap_content" android:layout_width="fill_parent"
android:layout_weight="0.5" />
</LinearLayout>

What is the expected output? What do you see instead?

The code above should produce 2 identical EditTexts one next to the other. Instead - only one is visible, expanded 100% width and the other is not selectable, it is outside of the screen.

What version of the product are you using? On what operating system? Online version as on December 28th, 2010

Please provide any additional information below.

How to update both EditTexts simultaneously?

Comment #1

Posted on Jan 24, 2011 by Quick Dog

Accepted, DroidDraw currently only handles weight = "1"

Comment #2

Posted on Jan 1, 2012 by Quick Dog

DroidDraw now supports arbitrary weights and the weightSum attribute.

Comment #3

Posted on Jan 1, 2012 by Quick Dog

Fixed in SVN targeted for r1b21

Status: Fixed

Labels:
Type-Defect Priority-Medium