如何在iPhone应用程序中实现Wikitude API? [英] How to implement Wikitude API in iPhone Application?
问题描述
我想在我的iPhone应用程序中实现Wikitude API.但是,在我的应用程序中实现此API时,我陷入了困境.我有一个视图控制器,在其中单击一个按钮时我想打开它,例如[wikitudeAR start][self.view addSubview:[wikitudeAR start]];
I want to implement the Wikitude API in my iPhone Application. But while implementing this API in my application i got stuck in one point. I am having one view controller in which i am having one button on clicking on which i want to open this [wikitudeAR start] as like [self.view addSubview:[wikitudeAR start]];
但是它不能正常工作.它没有显示我想在单击按钮时显示的摄像机视图([wikitudeAR start]).
But it is not working properly. It is not showing the camera view ([wikitudeAR start]) which i want to show on clicking of button.
在您提供了wikitude API的示例应用程序中,显示如下[window addSubview:[wikitudeAR start]];
In sample application which you have provided with wikitude API is showing like [window addSubview:[wikitudeAR start]];
但是我想在我的视图上而不是在主窗口上显示wikitudeAR视图(wikitudeAR摄像机视图).
But i want to show the wikitudeAR view (wikitudeAR camera view) over my view and not over the main window.
谢谢.
推荐答案
这对我有用,在VerificationDidSucceed中,将控制器添加到窗口:
Hi this works for me, in verificationDidSucceed add the controller to window:
- (void) verificationDidSucceed {
//appDel is an AppDelegate shared instance of your application
[appDel.window addSubview: [wikitudeAR start]];
}
然后,一旦启动"控制器,便可以使用显示/隐藏功能来显示控制器.您可以定义一个IBAction,如果您已经启动了控制器,则只需显示它即可;否则,您可以定义一个IBAction.
then you can use show/hide functions to display the controller once you have "start" the controller. You can define an IBAction, if you have already start the controller just show this;
-(IBAction)startAR{
if (wikitudeAR == nil) {
wikitudeAR = [[WikitudeARViewController alloc] initWithDelegate:self applicationPackage:APPPACKAGE_WIKITUDE_ applicationKey:APPKEY_WIKITUDE_ applicationName:APPNAME_WIKITUDE_ developerName:APPDEVELOPER_WIKITUDE_];
}else {
[wikitudeAR show];
}
}
然后调用隐藏"功能以隐藏控制器.
then call "hide" function to hide the controller.
这篇关于如何在iPhone应用程序中实现Wikitude API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!