【发布时间】:2017-02-17 07:09:31
【问题描述】:
我已经在 ViewPager 中添加了 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 并没有解决问题。
标签: android xml android-layout listview