I would like to realize a LinearLayout in Android like this:
{ deleted image }
but I don’t know how to do.
If I do:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="60dp" >
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="60dp" >
<TextView android:text="TextView" android:id="@+id/item_0"
android:layout_width="wrap_content"
android:layout_height="30dp" >
</TextView>
<TextView android:text="TextView" android:id="@+id/item_1"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:textSize="18dp"
android:textColor="#ff0000">
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="80dp"
android:gravity="right"
android:layout_height="60dp" >
<TextView android:text="TextView" android:id="@+id/item_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="20dp"
android:textColor="#ff0000">
</TextView>
</LinearLayout>
</LinearLayout>
The second LinearLayout (on the right) is not shown. I think I would have to use a RelativeLayout, but how can I draw a similar LinearLayout?
This is the layout used for a ListItem in a ListView so every box has to have the same width (hence cannot use wrap_content for the 2 item_0 and item_1 layout wrapper.
1 Answer