- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
button.frame = CGRectMake(0, 200, 100, 100);
[button setTitle:@"测试" forState:UIControlStateNormal];
[self.view addSubview:button];
[button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
baiduVoiceVC = [[BDRecognizerViewController alloc] initWithOrigin:CGPointMake(20, 100) withTheme:[BDTheme lightOrangeTheme]];
// baiduVoiceVC.enableFullScreenMode = YES;
baiduVoiceVC.delegate = self;
}
- (void)buttonAction:(UIButton *)button
{
BDRecognizerViewParamsObject *objc = [[BDRecognizerViewParamsObject alloc] init];
objc.apiKey = @"xxx";
objc.secretKey = @"xxx";
[baiduVoiceVC startWithParams:objc];
}
这么写, 为什么点击按钮只是显示一下 请等候1秒直接消失.
控制台有什么输出打印吗?