我正在尝试创建一个自定义 alertview 类,但在为点击的 View 创建完成 block 时遇到问题
我想要的是这样的,
+ (void)alertviewUIViewController*)vc handlervoid (^)(UITapGestureRecognizer *))callback{
UILabel *lbl1 = [[UILabel alloc] init];
lbl1.text = @"A";
UILabel *lbl2 = [[UILabel alloc] init];
lbl1.text = @"B";
UILabel *lbl3 = [[UILabel alloc] init];
lbl1.text = @"C";
}
当用户触摸时,例如 lbl2
[RFAlertView alertview:self handler:^(UITapGestureRecognizer *selected){
NSLog(@"selected label is : %@",selected);
}];
检查您的 UILabel
是否将 UserInteractionEnabled
设置为 YES
关于ios - 创建警报 View 并点击标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42410838/
欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://jike.in/) | Powered by Discuz! X3.4 |