1.去掉自带点击边框效果:

        

设置属性:android:listSelector="@android:color/transparent"  即可.


2.禁止上下滑动

public class HotKeyGridView extends GridView {public HotKeyGridView(Context context, AttributeSet attrs, int defStyle) {super(context, attrs, defStyle);// TODO Auto-generated constructor stub}public HotKeyGridView(Context context, AttributeSet attrs) {super(context, attrs);// TODO Auto-generated constructor stub}public HotKeyGridView(Context context) {super(context);// TODO Auto-generated constructor stub}public boolean dispatchTouchEvent(MotionEvent ev) {// TODO Auto-generated method stubif(ev.getAction() == MotionEvent.ACTION_MOVE){return true;//禁止Gridview进行滑动}return super.dispatchTouchEvent(ev);}}

不分发 滑动事件即可。

更多相关文章

  1. android GridView 去掉自带点击边框效果和禁止上下滑动
  2. android中处理各种触摸事件
  3. build WebRTC for android
  4. 【android】时间选择器
  5. Android设置竖屏
  6. Setting Text to Image On Android(安卓)and Adjudt the text fo
  7. scrollview--android
  8. android > 禁止横竖屏切换
  9. Android中丰富多彩的onTouch事件

随机推荐

  1. Android入门级之WebView的使用
  2. Android中ProgressDialog的使用
  3. Android(安卓)onMeasure
  4. Android(安卓)View动画——自定义View动
  5. Android8.0源码解析——Activity的启动过
  6. LisetView Item高度设置无效
  7. [android] Http Post 请求
  8. Android(安卓)对话框(三)自定义对话框
  9. Android(安卓)APP如何做开场渐变动画
  10. Android(安卓)断点续传下载