oShenLi1 2015-04-22 16:36 采纳率: 0%
浏览 5826

listview调用addfooterview添加页脚,发现页脚底部有条线,请问怎么去除?

如题“listview调用addfooterview添加页脚,发现页脚底部有条线,请问怎么去除?”

下面是我的代码

listview

 <ListView
        android:id="@+id/search_history_list"
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:cacheColorHint="#00000000"
        android:padding="@dimen/padding_15"
        android:scrollbars="none" />  

item.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <TextView
        android:id="@+id/name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="@dimen/padding_10"
        android:singleLine="true"
        android:textSize="@dimen/text_size_16"
        android:textColor="@color/gray_3" />

</RelativeLayout>

代码片段

listView = (ListView) findViewById(R.id.search_history_list);
        historyAdapter = new SearchHistoryAdapter(this, historyList);
        clearView = LayoutInflater.from(this).inflate(R.layout.search_footview,
                null);
        txtClear = (TextView) clearView.findViewById(R.id.txtClear);
        listView.addFooterView(clearView);
        listView.setAdapter(historyAdapter);
  • 写回答

3条回答 默认 最新

  • zhangzhonghu551102 2015-04-22 23:51
    关注

    加headerview或者footerview,监听滑动,动态改变view的高度,根据需要改变布局中item的状态,或者加动画什么的,具体看代码

    评论

报告相同问题?