0
我创建了自定义FrameLayout。我在主体周围增加了1个主圈和5个圈。我想围绕主圈旋转圈子。在自定义FrameLayout中旋转Multi ImageView
public class Circles extends FrameLayout{
ImageView mMainCircle;
ImageView mCircle0;
ImageView mCircle1;
ImageView mCircle2;
ImageView mCircle3;
ImageView mCircle4;
public Circles(Context context) {
super(context, null, 0);
init();
}
public Circles(Context context, AttributeSet attrs) {
super(context, attrs, 0);
init();
}
public Circles(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
public void init(){
// set positions, onClick and add
Cicle.setOnClickListener(mOnClickListener);
this.addView(mMainCircle);
this.addView(Circle0);
this.addView(Circle1);
this.addView(Circle2);
this.addView(Circle3);
this.addView(Circle4);
}
}
我该怎么做可以围绕主要圆圈旋转的所有圆圈。我尝试了所有的circleX setOnTouchListener,但它不起作用。
CircleX.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
break;
case MotionEvent.ACTION_MOVE:
break;
case MotionEvent.ACTION_UP:
break;
default:
break;
}
return false;
}
});
我需要一个代码,如果有可能或例如:)
THX 套件
我完全不明白你想要什么。您想要在主图像周围添加图像,o制作旋转动画,其中用户可以旋转图像环? – neworld
没有动画。触摸其中一个并围绕主图像旋转。 – user1509068