android startDrag()开始拖动一个View 并用 OnDragListener监听拖动的状态。 如何设置被拖动View的移动范围?就是让被拖动的View只能在屏幕的一部分移动,拖不到其它位置。期待高手

解决方案 »

  1.   

    如何让被拖动的view只能在一定范围内移动?????
      

  2.   

    以前没写过,我上网给你搜了点例子。startDrag中有个可传参数Rectangle用于规定范围(false, new Rectangle(xPos,yPos,width,height))或者
    var left:Number = 0;
    var top:Number = 0;
    var width:Number = 200;
    var height:Number = 300;
    var rect:Rectangle = new Rectangle(left,top, width, height);circle.startDrag(false,rect);希望对楼主有用
      

  3.   


    这个是android里的startDrag  ??