简体   繁体   中英

Wikitude SDK remove from superview

I have implement Wikitude SDK and I manage to initialize using this code:

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

How I will go back to my MainViewController View? (I want to call it from object "custombutton")

I guess your WikitudeARViewController delegate is application delegate.

1) Implement your own View controller, from where you want to launch AR Browser (on button click, preferably).

2) Instantiate WikitudeARViewController from your ViewController(button event) and making ViewController as delegate.

3) make view returned from [wikitudeAR start] to the ViewController.view (and not window.view).

Hope this helps.

you can use CustomMenuButtonDelegateImpl1.m

@implementation CustomMenuButtonDelegateImpl1

- (void) customMenuButtonPressed:(WTPoi *)currentSelectedPoi {
    //NSLog(@"addpoi");



    [[WikitudeARViewController sharedInstance] hide];
    [UIApplication sharedApplication].statusBarHidden = NO;

    }


@end

and it woroks very well

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM