删除Listview中第一个项目顶部的行
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的背景放在一边,这样你就可以看到我滚动的那个小空间。
<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:
以下是滚动列表时的样子(您可以看到空格已经消失),但当您位于列表顶部时,会再次显示:
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>
更多相关文章
- android textview空格占位符以及一些其他占位符汇总
- 在android上滚动时,列表视图的位置会发生变化
- android 获取正在运行的应用程序列表
- 自定义BaseAdapter,在主Activity页面调用显示歌曲列表
- javascript实现设置select下拉列表框中选中内容。
- 根据用户的动态字段对链接列表进行排序
- javascript去掉前后空格
- 添加到arraylist中的列表时IndexOutOfBoundsException
- Java操作ini文件 ,解决properties文件中无法读取换行及空格