您的位置:首页 > 其它

处理 listview gridview ScrollView 最顶、最低时 依然下拉 出现的发光阴影

2015-02-15 09:40 274 查看
1.如题,搜了很久 很多都是不是回答的关键,一直以为是别人重写了控件,现在找到了可以在xml中加入 android:overScrollMode="never"

2.重写控件时候 这样就不需要在xml中自己设置

public ElasticScrollView(Context context, AttributeSet attrs, int defStyle) {

super(context, attrs, defStyle);

initScrollView();

}

public ElasticScrollView(Context context, AttributeSet attrs) {

this(context, attrs, 0);

}

public ElasticScrollView(Context context) {

this(context, null);

}

private void initScrollView() {

// 设置滚动无阴影( API Level 9 )

if (Build.VERSION.SDK_INT >= 9) {

setOverScrollMode(View.OVER_SCROLL_NEVER);

} else {

ViewCompat.setOverScrollMode(this, ViewCompat.OVER_SCROLL_NEVER);

}

}

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐