0

我正在尝试使用 4 个按钮(如 imageview 子视图)顺时针旋转圆形图像。它使用核心动画与按钮一起旋转,但是当我点击任何按钮时它不会导航另一个页面,请帮助我

提前致谢

我在这里给出我的代码

    CABasicAnimation *fullRotation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
    fullRotation.fromValue = [NSNumber numberWithFloat:0];
    fullRotation.toValue = [NSNumber numberWithFloat:((360*M_PI)/180)];
    fullRotation.duration = 150.0f;
    fullRotation.repeatCount = 20.0;
    [self.image_Wheel addSubview:self.btn1];
    [self.image_Wheel addSubview:self.btn2];
    [self.image_Wheel addSubview:self.btn3];
    [self.image_Wheel addSubview:self.btn4];
    [self.image_Wheel.layer addAnimation:fullRotation forKey:@"360"];
4

3 回答 3

1

非常好的问题。您应该使用视图并在其上添加所有按钮和图像。旋转视图而不是图像和按钮将起作用。

于 2013-03-25T09:17:32.477 回答
0

userInteractionEnabled属性设置UIImageViewYES

于 2013-03-25T05:56:34.963 回答
0

尝试

self.image_Wheel.userInteractionEnabled = YES;

也尝试将 设置btn在前面。

于 2013-03-25T05:59:55.527 回答