不要调用CKRadialMenu的委托方法

时间:2016-11-04 04:33:39

标签: ios objective-c

我使用CKRadialMenu库。有一种方法

- (void) addPopoutView: (UIView *) popoutView withIndentifier: (NSString *) identifier

我传递了这样的图像视图..

UIImageView *imgForFood2 = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"food-icon-img 40.png"]];
[_radialView addPopoutView:imgForFood2 withIndentifier:@"ONE"];

在输出中图像将添加,但是当我尝试单击此popOutView时,其委托方法不会触发。 这是委托方法

-(void)radialMenu:(CKRadialMenu *)radialMenu didSelectPopoutWithIndentifier:(NSString *)identifier;

请帮帮我。

2 个答案:

答案 0 :(得分:1)

您只需要在Imageview上启用用户交互。

UIImageView *imgForFood2 = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"food-icon-img 40.png"]];

[imgForFood2 setUserInteractionEnabled:TRUE];
[radialView addPopoutView:imgForFood2 withIndentifier:@"ONE"];

答案 1 :(得分:0)

试试这个

UIImageView *imgForFood2 = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"food-icon-img 40.png"]];
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
[view addSubview:imgForFood2];
[radialView addPopoutView:view withIndentifier:@"ONE"];