I’m creating a ListView where each list item has a LinearLayout which I would like to use to dynamically add multiple input components. I use the following layout for the list items.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
...
<LinearLayout
android:id="@+id/input_container"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
When I add multiple checkboxes to the input_container I only see the first checkbox. The LinearLayout‘s height seems to be correct though (there is room for the missing checkboxes).
The result looks something like:
--------------------------
List item 1
[_] Option 1
--------------------------
List item 2
Remember to use the correct Orientation.
By default, LinearLayout has a horizontal orientation.
So your xml will look like this
You can read more about
LinearLayoutand its orientation here: Android Developer: LinearLayout