Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/198.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android ListView不显示最后一项_Android_Listview - Fatal编程技术网

Android ListView不显示最后一项

Android ListView不显示最后一项,android,listview,Android,Listview,我已经环顾四周,找到了一些答案,但其中有些不符合我的设想。我的屏幕空间相对较小。因此,我不想使用 android:layout_marginBottom="?attr/actionBarSize" 这是可行的,但就像我说的,我没有太多的空间。如果listview的最后一项没有完全显示/显示,是否有其他方法解决此问题?我还需要刷新屏幕上的所有项目,例如,4行项目正好适合listview,这意味着您在滚动之前无法在该屏幕上看到任何其他行 编辑: 这是我的列表视图 <ListView xmln

我已经环顾四周,找到了一些答案,但其中有些不符合我的设想。我的屏幕空间相对较小。因此,我不想使用

android:layout_marginBottom="?attr/actionBarSize"
这是可行的,但就像我说的,我没有太多的空间。如果listview的最后一项没有完全显示/显示,是否有其他方法解决此问题?我还需要刷新屏幕上的所有项目,例如,4行项目正好适合listview,这意味着您在滚动之前无法在该屏幕上看到任何其他行

编辑:

这是我的列表视图

<ListView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/infoList"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:animateLayoutChanges="true"
    android:background="@color/black"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="16dp"
    android:paddingBottom="16dp"
    />

这是添加到listview的我的项目的xml

<android.support.constraint.ConstraintLayout 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/info_view_item_nodesc_constraint_layout"
android:layout_width="fill_parent"
android:layout_height="80dp"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:orientation="horizontal">


<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/infoName"
    android:layout_width="wrap_content"
    android:layout_height="28dp"
    android:layout_marginBottom="22dp"
    android:layout_marginLeft="8dp"
    android:layout_marginStart="8dp"
    android:layout_marginTop="22dp"
    android:gravity="center_vertical"
    android:minHeight="?android:attr/listPreferredItemHeightSmall"
    android:textColor="@color/white"
    android:textSize="@dimen/poi_list_entry_text_size"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintTop_toTopOf="parent" />


<ImageView
    android:id="@+id/infoIcon"
    android:layout_width="32dp"
    android:layout_height="32dp"
    android:layout_marginBottom="8dp"
    android:layout_marginEnd="8dp"
    android:layout_marginRight="8dp"
    android:layout_marginTop="8dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent" />
   </android.support.constraint.ConstraintLayout>


此外,我的屏幕底部有一个ActionMenuView,大小与顶部的操作栏相同。

切换到recycler视图解决了问题。

如果没有布局的XML,很难回答问题