开发者

How to implement Wikitude API in iPhone Application?

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]];

But it is not working properly. It is not showing the camera view ([wikitudeAR start]) which i w开发者_运维百科ant to show on clicking of button.

In sample application which you have provided with wikitude API is showing like [window addSubview:[wikitudeAR start]];

But i want to show the wikitudeAR view (wikitudeAR camera view) over my view and not over the main window.

Thanks in advance.


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]];
    }

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜