Open hot-man opened 7 years ago
我直接_btnRecord = [BBHoldToSpeakButton buttonWithType:UIButtonTypeCustom]; _btnRecord.frame = CGRectMake(30, 300, 300, 49); _btnRecord.layer.borderWidth = 0.5; _btnRecord.layer.borderColor = LineColor.CGColor; _btnRecord.layer.cornerRadius = 4; _btnRecord.layer.masksToBounds = YES; _btnRecord.enabled = NO; //将事件往上传递 _btnRecord.titleLabel.font = [UIFont boldSystemFontOfSize:16]; _btnRecord.backgroundColor = Level5Color; [_btnRecord setTitleColor:Text3Color forState:UIControlStateNormal]; [_btnRecord setTitleColor:Text3Color forState:UIControlStateHighlighted]; [_btnRecord setTitle:@"按住 说话" forState: UIControlStateNormal]; [self.view addSubview: _btnRecord]; 怎么点击没啥反应
不需要添加点击事件吗
你看我例子里,事件放在touchesBegan、touchesMoved、touchesEnded和touchesCancelled里处理了
我这边不知道是不是被tableview的事件屏蔽了
应该是跟tableview的手势冲突了
弹出录音框的时候可以把tableview.userInteractionEnabled关闭就行 谢谢了
我直接_btnRecord = [BBHoldToSpeakButton buttonWithType:UIButtonTypeCustom]; _btnRecord.frame = CGRectMake(30, 300, 300, 49); _btnRecord.layer.borderWidth = 0.5; _btnRecord.layer.borderColor = LineColor.CGColor; _btnRecord.layer.cornerRadius = 4; _btnRecord.layer.masksToBounds = YES; _btnRecord.enabled = NO; //将事件往上传递 _btnRecord.titleLabel.font = [UIFont boldSystemFontOfSize:16]; _btnRecord.backgroundColor = Level5Color; [_btnRecord setTitleColor:Text3Color forState:UIControlStateNormal]; [_btnRecord setTitleColor:Text3Color forState:UIControlStateHighlighted]; [_btnRecord setTitle:@"按住 说话" forState: UIControlStateNormal]; [self.view addSubview: _btnRecord]; 怎么点击没啥反应