我有一个布局,但@id/category_starred_icon
没有显示 ImageView,预期的行为是将带有 2 TextView 的 LinearLayout 扩展到所有可用的空白空间,但没有显示 ImageView
<?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="wrap_content"
android:orientation="vertical"
android:background="@drawable/borders" >
<View
android:id="@+id/category_color"
android:layout_width="match_parent"
android:layout_height="5dp"
android:background="@color/awazari_blue" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/category_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textIsSelectable="false"
android:textSize="18sp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:paddingRight="5dp"
android:textColor="@android:color/black"
android:hint="@string/app_name" />
<TextView
android:id="@+id/category_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textIsSelectable="false"
android:maxLines="3"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:textColor="@color/awazari_medium_gray"
android:ellipsize="end"
android:hint="@string/description" />
</LinearLayout>
<ImageView
android:id="@+id/category_starred_icon"
android:layout_width="64dp"
android:layout_height="64dp"
android:src="@drawable/unstarred"
android:contentDescription="@string/app_name"
android:layout_gravity="right" />
</LinearLayout>
</LinearLayout>