android imageView: setting drag and pinch zoom parameters

前端 未结 7 1864
太阳男子
太阳男子 2020-11-27 14:06

I am currently developing for Android (my first app) an application which lets users see the subway map and be able to pinch zoom and drag around.

I am currently mod

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-27 14:46

    you can use following code to limit bottom and right

    float maxX = minX+viewWidth; 
    int offsetY = 80;
            float maxY = minY+viewHeight-offsetY;
           if(x>maxX){
               mPosX = maxX;
           }
           if(xmaxY){
               mPosY = maxY;
           }
           if(y

提交回复
热议问题