Я пытаюсь создать этот простой макет в Android.
A следует обернуть в соответствии с его содержимым и выровнять left|center_vertical
.
B должен расширяться как можно больше, заполняя все пустое пространство.
C должен быть выровнен по правому краю, обернут для заполнения его содержимого и также выровнен center_vertical
Вот мой макет:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:gravity="left|center_vertical">
<!-- A -->
<ImageView android:id="@+id/example_item_icon"
android:layout_width="48px"
android:layout_height="48px"/>
<!-- B -->
<LinearLayout android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="left|center_vertical"
android:padding="5px">
<TextView android:id="@+id/example_item_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"/>
<TextView android:id="@+id/example_item_level_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold|italic"
android:lines="1"
android:textSize="10px"/>
</LinearLayout>
<!-- C -->
<TextView android:id="@+id/example_item_count_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textSize="14px"/>
</LinearLayout>
В этом макете C выталкивается за пределы экрана. Как я могу заставить этот макет работать?