我已经在ViewPager中添加了ListView,一旦加载页面,第一个选项卡被选中并且列表的最后一项没有第一次显示,它的当我到下一个标签并回来时变得可见。我希望在第一次加载时看到listview的所有项目。请帮我解决这个问题。Android-ListView的最后一项不可见
这是为ListView的XML -
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/listview_categories"
android:layout_width="fill_parent"
android:divider="@color/light_gray_a1"
android:dividerHeight="0.667dp"
android:background="@color/white"
android:layout_height="fill_parent" />
</RelativeLayout>
你应该使用'match_parent',而不是'fill_Parent' –
添加match_parent不能解决问题。 –