это что-то вроде процентного подхода макета. Я не знаю, как это работает, но вот мой готовый продукт, который выглядит великолепно:

аюсь создать этот простой макет в 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 выталкивается за пределы экрана. Как я могу заставить этот макет работать?

Ответы на вопрос(4)

Ваш ответ на вопрос