我通过使用 Vuforia 进行开发,在 iOS 上进行有关增强现实的项目。
我在开始之前创建了视图FrameMarkerAppDelegate
(扫描 AR 视图)。在我推送UIButton
on view 页面后,FrameMarkerAppDelegate
它就开始了。背景是FrameMarkerAppDalegate
运行完成后的相机背景。然后我触摸相机背景并选择返回查看页面,现在我们再次进入查看页面。
我的问题是UIButton
再次按下后,相机背景没有出现。它仍然是查看页面,但相机已激活。
视图控制器.mm
- (IBAction)btnSelect:(id)sender {
FrameMarkersAppDelegate *appDelegate = [[FrameMarkersAppDelegate alloc] init];
[appDelegate startFrameAppDelegate];
}
FrameMarkerAppDelegate.mm
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
CGRect screenBounds = [[UIScreen mainScreen] bounds];
window = [[UIWindow alloc] initWithFrame: screenBounds];
[self setupSplashContinuation];
[QCARutils getInstance].targetType = TYPE_FRAMEMARKERS;
arParentViewController = [[ARParentViewController alloc] init];
arParentViewController.arViewRect = screenBounds;
[window insertSubview:arParentViewController.view atIndex:0];
[window makeKeyAndVisible];
return YES;
}
-(void)startFrameAppDelegate
{
CGRect screenBounds = [[UIScreen mainScreen] bounds];
window = [[UIWindow alloc] initWithFrame: screenBounds];
[self setupSplashContinuation];
[QCARutils getInstance].targetType = TYPE_FRAMEMARKERS;
arParentViewController = [[ARParentViewController alloc] init];
arParentViewController.arViewRect = screenBounds;
[window insertSubview:arParentViewController.view atIndex:0];
[window makeKeyAndVisible];
}