我正在尝试编写一个我可以在Android中使用的图形类(我知道预先存在的图形类),但转换我的所有坐标都会很痛苦.是否有一种简单的方法可以让屏幕坐标从左下方开始?
我有一个问题:我的自定义列表视图在缩放前不会滚动.缩放按预期工作.我该如何解决这个问题?
ZoomableListView:
public class ZoomableListView extends ListView {
private ScaleGestureDetector mScaleDetector;
private float mScaleFactor = 1.f;
private boolean isPagerEnabled;
private static final int INVALID_POINTER_ID = -1;
// The ‘active pointer’ is the one currently moving our object.
private int mActivePointerId = INVALID_POINTER_ID;
private float mPosX;
private float mPosY;
private float mLastTouchX;
private float mLastTouchY;
// Pivot point for Scaling
static float gx = 0, gy = 0;
public ZoomableListView(Context context, AttributeSet attrs) {
super(context, attrs);
mScaleDetector = new ScaleGestureDetector(getContext(), new …Run Code Online (Sandbox Code Playgroud)