本帖最后由 qq271967835 于 2014-05-13 22:21:52 编辑

解决方案 »

  1.   

    LayoutInflater inflater = (LayoutInflater)getActivity(). getSystemService(Context.LAYOUT_INFLATER_SERVICE);//(该行getSystemService()编译出错                 ),我之前是这么弄得,你试试吧,不行我也不会了,我刚刚学这个
      

  2.   

    使用context调用getSystemService,先获取Context
      

  3.   

    你的public boolean onFling(MotionEvent arg0, MotionEvent arg1, float arg2,
    float arg3) {
    // TODO Auto-generated method stub
    return false;
    }滑动没实现,所以没有滑动效果
      

  4.   

    除了重载 onFling(MotionEvent arg0, MotionEvent arg1, float arg2,
    float arg3)还要重载
    public boolean onTouchEvent(MotionEvent event) {
    // TODO Auto-generated method stub
    return this.detector.onTouchEvent(event); 
    }
    这样就使得detector能接受消息响应了。
      

  5.   

    detector指的是GestureDetector类型的变量,也就是你程序的mGestureDetector