android - 以Listview为item的Listview,内部listview不完全可见

标签 android android-listview

我正在尝试使用 ListView 作为项目的 ListView ,只有第一行在内部 ListView ( ListView 项目)中可见。

我的 ListView 项目 xml 是:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/main_bg" >
    <ListView
        android:id="@+id/numbers_list"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:cacheColorHint="@null"
        android:divider="@null" >
    </ListView>
</RelativeLayout>

最佳答案

你不能有 scrollable view in other scrollable views .如果将 ListView 放在 ScrollView 中,也会发生同样的情况。
为了您的目的,为什么不实现多个 View 项目类型?示例 herehere .

关于android - 以Listview为item的Listview,内部listview不完全可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19930596/

相关文章:

android - 如何在我现有的 Android 应用程序中使用 Telegram API(包括聊天应用程序)?

java.lang.NullPointerException : Attempt to invoke virtual method 'onMemberDareLoaded(java.lang.String)' on a null object reference

java - 平板电脑用户界面在我的应用程序上不起作用

android - 每个 ListView 行中的重力不同

android - 空指针异常 - 显示用户在服务器的 ListView 中下的订单

Android - 如何将 View 的 x 和 y 坐标放入 gridLayout 中?

java - 在android中解析asynctask内的json

android - ListView 很慢-android

android - 加载下一个新项目android时如何更新 ListView ?

ListView 中的 Android WebView onclick 事件问题