我已經在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不能解決問題。 –