android - 嵌套的listView在cardView中没有全尺寸
问题描述
我需要帮助。我有一个包含不同视图的 RecyclerView,例如 Cardviews。这些 CardViews 包含一个 ListView
cardViews 高度是包装内容,listviews 高度也是包装内容。
第一张卡片中的 listView 包含三个项目,第二张卡片只有一个,最后一张卡片有一个子项。
如果卡片的内容发生变化或可扩展列表视图打开,我如何存档卡片的增长
我很抱歉我的英语不好
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/card_vocdetail_general"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ExpandableListView
android:id="@+id/card_vocdetail_expandableList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minHeight="48dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/card_vocdetail_more"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/card_vocdetail_expandableList">
<TextView
android:id="@+id/card_vocdetail_more_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/card_detail_voc_more_sides"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/card_vocdetail_expandableList" />
<TextView
android:id="@+id/textView28"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:clickable="true"
android:gravity="end"
android:text="@string/show_more" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
解决方案
推荐阅读
- python-3.x - Gurobi:在目标函数中添加对数项和指数项?
- python - 你如何在应用程序之间使用 ManyToManyFields 而不产生循环导入?
- html - 使用 Bootstrap 的产品示例并试图弄清楚我如何添加图像
- javascript - 是否可以使用 JavaScript 控制鼠标跟踪速度(光标移动多少以响应鼠标的运动)
- python - 如何在 Python 中将字符串的内容作为代码的一部分?
- python - 有没有办法让给定类的 HTML 分区必须是连续的?
- r - 通过 R 中的 system2() 对终端提示响应是
- postgresql - 将 MySQL 中的 SUBSTRING_INDEX() 转换为 PostgreSQL
- docker - 运行 docker exec 时如何获取 psql select 命令的输出?
- karate - 带有 ExecutionHook 监听器的空手道跑步者