去除 ListView 上下边界蓝色或黄色阴影

来源:互联网 发布:淘宝会员v等级 编辑:程序博客网 时间:2024/05/21 18:37

在 2.3 版本之前可以在 ListView 的属性中通过设置 android:fadingEdge="none" 来解决问题,但是在 2.3 及以上版本这中方法是无效的,这里,可以通过重写 ListView 用代码来设置模式,禁止其阴影的出现,以免影响美观。

public PinnedSectionListView(Context context, AttributeSet attrs) {        super(context, attrs);        initView();    }    public PinnedSectionListView(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);        initView();        if (Integer.parseInt(Build.VERSION.SDK) >= 9) {            this.setOverScrollMode(View.OVER_SCROLL_NEVER);        }    }


0 0
原创粉丝点击