解决方案 »

  1.   

    这个 我感觉可以 自己手动画一个VIEW 然后做一下手势监听每次监听到就 重绘制下。在具体的我也没法说了(没做过),大体上感觉是这样的!
      

  2.   

    用view画,添加监听事件,然后重绘一下。
      

  3.   

    需要你计算触控点,来实时旋转画布,canvas的rotate ,
      

  4.   

    手电筒,呵呵,刚刚看到苹果的APP审查原则:
    2.1 崩溃的程序将会被拒绝。
    2.2 存在错误的程序将会被拒绝。

    2.11 与App Store已有程序重复的应用可能会被拒绝,特别是数量很多的情况下,比如手电筒应用和爱经应用。
      

  5.   

    首先,非常感谢各位的热心帮助。
    我已经做了一些,但旋转角度老有问题,现贴上代码,求指导
    public class MyView extends View 
    {
    private Bitmap bmp;  //旋转指针图片
    private Bitmap bmpCenter;  //中心的开关按钮图片
    private Bitmap bmpOuter;  //旋转指针图片对应的旋转刻度图片

    //开关按钮中心点坐标
    private float centerX;
    private float centerY;

    //起始触摸点坐标
    private float downX;
    private float downY;

    private Matrix mtx;
    private float rotateAngle;  //旋转角度
    private boolean isTouch;  //判断触摸点是否在旋转指针图片上

    public MyView(Context ctt,  float x, float y)
    {
    super(ctt);

    bmp = ((BitmapDrawable)getResources().getDrawable(R.drawable.ic_rotating)).getBitmap();
    bmpCenter = ((BitmapDrawable)getResources().getDrawable(R.drawable.ic_flashlight_switch_close)).getBitmap();
    bmpOuter = ((BitmapDrawable)getResources().getDrawable(R.drawable.ic_scale_bg)).getBitmap();

    centerX = x;
    centerY = y;

    downX = 0;
    downY = 0;
    isTouch = false; mtx = new Matrix();

    }

    @Override
    public void onDraw(Canvas cvs)
    {
    super.onDraw(cvs);

    cvs.drawBitmap(bmpCenter, centerX-bmpCenter.getWidth()/2, centerY-bmpCenter.getHeight()/2, null);
    cvs.drawBitmap(bmpOuter, centerX-bmpOuter.getWidth()/2, centerY-bmpOuter.getHeight()/2, null);

    mtx.setRotate(rotateAngle, centerX, centerY);
    cvs.setMatrix(mtx);

    cvs.drawBitmap(bmp, centerX-bmp.getWidth()/2, centerY-bmp.getHeight()/2, null); }

    public boolean onTouchEvent(MotionEvent e)
    { if (e.getAction() == MotionEvent.ACTION_DOWN) 
    {
    downX = e.getX();
    downY = e.getY();
    //确保触摸点在旋转指针图片上
    if (getDistance(downX, downY, centerX, centerY)>bmpCenter.getWidth()/2  
    && getDistance(downX, downY, centerX, centerY)<bmp.getWidth()/2)
    {
    isTouch = true;
    }
    else
    {
    isTouch = false;
    }
    }
    else if (e.getAction() == MotionEvent.ACTION_MOVE)
    {
    if (isTouch)
    {
    rotateAngle = calAngle(downX, downY, e.getX(), e.getY());
    Log.e("MyView", "rotateAngle:" + rotateAngle);
    invalidate();
    }
    }
    else if (e.getAction() == MotionEvent.ACTION_UP)
    {
    }

    return true;

    }

    public float calAngle(float x1, float y1, float x2, float y2)  //计算旋转角度
    {
    double dis1 = getDistance(x1, y1, centerX, centerY);
    double dis2 = getDistance(x2, y2, centerX, centerY);
    double dis = getDistance(x1, y1, x2, y2);

    //反余弦定理
    double cos = (dis1+dis2-dis) / (2*(double)Math.sqrt(dis1)*(double)Math.sqrt(dis2));

    return -(float)(Math.acos(cos) * 180 /  Math.PI);
    }

    public float getDistance(float x1, float y1, float x2, float y2)  //获取两点之间的距离
    {
    return (float)Math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
    }
    }
      

  6.   

    本人新手,做练习用的。暂时还没想过要上苹App Store