У меня есть этот макет:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/fill_parent"
android:background="@color/white"
android:padding="2dip">
<ImageView
android:id="@+id/img_album"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="6dip"
android:layout_centerVertical="true"
android:padding="5dp"
/>
<LinearLayout
style="@style/fill_parent"
android:orientation="horizontal"
android:layout_toRightOf="@id/img_album"
android:layout_centerVertical="true">
<TextView
android:id="@+id/album_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textColor="@color/black"
android:layout_marginRight="10dp"
/>
<TextView
android:id="@+id/picts_number"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="@color/black"
/>
</LinearLayout>
</RelativeLayout>
, который дает мне это изображение:
Я не знаю, почему я не получаю название альбомаа затем число пиктов.
Ну, я сделал что-то, используя свойство layout_weight как:
<TextView
android:id="@+id/album_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textColor="@color/black"
android:layout_marginRight="10dp"
android:layout_weight="1"
/>
<TextView
android:id="@+id/picts_number"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:layout_weight="1" />
И я действительно не знаю, почему, я получаю число рядом с заголовком,как
Может ли кто-нибудь сказать мне:
Почему я не получаю число в 1-м сценарии, а я получаю во 2-м,
Как развернуть текст на всю ширину линейного выхода, чтобы второй текст «Смартфоны ...» не растягивался, но соответствовал своему родителю.
Спасибо!