问题描述
|
我已经实现了Wikitude SDK,并设法使用以下代码进行初始化:
-(IBAction)launchAR:(id)sender{
wikitudeAR = [[WikitudeARViewController alloc] initWithDelegate:self applicationPackage:nil applicationKey:nil applicationName:nil developerName:nil];
}
- (void) verificationDidSucceed {
BuddyFinderAppDelegate *appDel = (BuddyFinderAppDelegate *)[[UIApplication sharedApplication] delegate];
[appDel.window addSubview: [wikitudeAR start]];
[window makeKeyAndVisible];
}
我将如何返回MainViewController视图?
(我想从对象\“ custombutton \”中调用它)
解决方法
您可以使用CustomMenuButtonDelegateImpl1.m
@implementation CustomMenuButtonDelegateImpl1
- (void) customMenuButtonPressed:(WTPoi *)currentSelectedPoi {
//NSLog(@\"addpoi\");
[[WikitudeARViewController sharedInstance] hide];
[UIApplication sharedApplication].statusBarHidden = NO;
}
@end
而且效果很好
, 我猜你的WikitudeARViewController
代表是应用程序代表。
1)实施自己的View控制器,从中启动AR浏览器(最好在按钮上单击)。
2)从您的ViewController(按钮事件)实例化WikitudeARViewController并使ViewController作为委托。
3)使视图从[wikitudeAR start]返回到ViewController.view(而不是window.view)。
希望这可以帮助。