I am having this issue with a Listview, I have a PagerSlidingTabs with 4 tabs and a ViewPager, in the fist tab I have a fragment with a Listview. The problem is that in the fist item of the list is a litle line that is not supposed to be there. I put the background of the Lisview Red so you can see this litle space that when I scroll is gone.

我有一个Listview的问题,我有一个带有4个选项卡和一个ViewPager的PagerSlidingTabs,在第一个选项卡中我有一个带有Listview的片段。问题是在列表的第一项中是一条不应该存在的痘痘线。我把Lisview Red的背景放在一边,这样你就可以看到我滚动的那个小空间。

enter image description here

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_above="@+id/adList"
    android:visibility="visible">

    <ListView
        android:id="@+id/matchDetailsListView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:clickable="false"
        android:divider="@null"
        android:dividerHeight="0dp"
        android:background="@color/red" />

</RelativeLayout>

Here is the code of the tabs:

这是选项卡的代码:

<com.astuetz.PagerSlidingTabStrip
                    android:id="@+id/tabs"
                    android:layout_width="match_parent"
                    android:layout_height="55dp"
                    android:background="@color/transparent"
                    android:textColor="@color/white"
                    app:pstsDividerColor="@color/transparent"
                    app:pstsIndicatorColor="@color/bg_match_detail"
                    app:pstsIndicatorHeight="10dp"
                    app:pstsShouldExpand="true"
                    app:pstsTabBackground="@color/transparent"
                    app:pstsTabPaddingLeftRight="18dp"
                    app:pstsTextAllCaps="false"
                    app:pstsTriangleIndicator="true"
                    app:pstsUnderlineHeight="0dp" />

And here is what looks like when scroll the list (You can see that the space is gone) but when you are in the top of the list appears again:

以下是滚动列表时的样子(您可以看到空格已经消失),但当您位于列表顶部时,会再次显示:

enter image description here

1 个解决方案

#1


0

Use this-:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_above="@+id/adList"
    android:visibility="visible">

    <ListView
        android:id="@+id/matchDetailsListView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:clickable="false"
        android:divider="@null"
        android:dividerHeight="0dp"
        android:background="@color/transparent" />

</RelativeLayout>

Instead of-:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_above="@+id/adList"
    android:visibility="visible">

    <ListView
        android:id="@+id/matchDetailsListView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:clickable="false"
        android:divider="@null"
        android:dividerHeight="0dp"
        android:background="@color/red" />

</RelativeLayout>

更多相关文章

  1. android textview空格占位符以及一些其他占位符汇总
  2. 在android上滚动时,列表视图的位置会发生变化
  3. android 获取正在运行的应用程序列表
  4. 自定义BaseAdapter,在主Activity页面调用显示歌曲列表
  5. javascript实现设置select下拉列表框中选中内容。
  6. 根据用户的动态字段对链接列表进行排序
  7. javascript去掉前后空格
  8. 添加到arraylist中的列表时IndexOutOfBoundsException
  9. Java操作ini文件 ,解决properties文件中无法读取换行及空格

随机推荐

  1. 说话时如何把“NO”变成“yes”?
  2. Azure DevTest Lab体验(二)用户测试
  3. 链路追踪 SkyWalking 源码分析 —— Coll
  4. 链路追踪 SkyWalking 源码分析 —— Coll
  5. 分布式作业系统 Elastic-Job-Cloud 源码
  6. 一文学会Vue中间件管道[每日前端夜话0x8C
  7. 链路追踪 SkyWalking 源码分析 —— Coll
  8. CPU 是怎样工作的?[每日前端夜话0x89]
  9. 造了一个 Redis 分布锁的轮子,没想到还学
  10. 链路追踪 SkyWalking 源码分析 —— Coll