0

我对此也很陌生,我在这里找到了一些很大的帮助,但不是针对这个问题。我正在使用具有内置扫描功能的 Wikitude SDK 4.0 构建应用程序。我试图在 ScanViewController 中实现一个关闭按钮,但没有成功。该应用程序按要求工作正常,扫描工作正常,但无法返回应用程序。我知道这一定是一个愚蠢的问题,但请帮忙,我快疯了!我做错了什么,我真的很想了解这一点。

这适用于 Wikiitude SDK 3.3 的早期版本,但不适用于 4.0。

我在用:

UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
[button setFrame:CGRectMake(0, 0, 100, 75)];
button.titleLabel.font = [UIFont systemFontOfSize:20];
[button setTitle:@"Close" forState:UIControlStateNormal];
[button setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
[button addTarget:self action:@selector(userDidPressCloseButton:) forControlEvents:UIControlEventTouchUpInside];

- (void)userDidPressCloseButton:(id)sender
{
    NSLog(@"Close");    
    UIViewController *closeScanner = [self.storyboard instantiateViewControllerWithIdentifier:@"MainPage"];
    [self presentViewController:closeScanner animated:YES completion:nil];
    [self dismissViewControllerAnimated:YES completion:Nil];
}

谢谢您阅读此篇。

4

1 回答 1

0

我认为您需要在按下后退按钮之前销毁 World 实例。它不会冻结应用程序。

您在一行中呈现视图控制器的另一件事是在下一行中您正在关闭该视图控制器。

于 2016-02-20T12:45:16.253 回答